Re: Problem with HitTest in DataGrid

From: Maria Anthonsen (mariant_at_INGENSPAMstart.no)
Date: 12/15/04


Date: Wed, 15 Dec 2004 13:27:01 +0100

Sorry - I should have given a better explanation...

I have filled a DataSet with data from a SQLServer database. I have set the
DataSource of the DataGrid to this dataset. When I click in one of the
cells in the datagrid - I would like to get the value to a textbox.

I have used the HitTest-function in the datagrid to get the value in the
cell - but the value in the first cell is highlighted, and the HitTest
doesn't work on this cell. It works on all other cell except this first
highlighted one.

Does you suggestion mean that the first cell will not be highlighted? If I
read the xml manually - how do I know witch cell was clicked?

Maria

"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message
news:uZTWKup4EHA.4028@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> You will have to read the xml in manually. Hopefully this will
> get you started.
> http://support.microsoft.com/default.aspx?scid=kb;en-us;301225
>
> Ken
> ---------------------
> "Maria Anthonsen" <mariant@INGENSPAMstart.no> wrote in message
> news:OFof9Mp4EHA.1976@TK2MSFTNGP09.phx.gbl...
> I'm using HitTest to get a value from the cells into a textbox. I have put
> the HitTest code into the MouseDown-event, and everything is working
> except
> one thing. When I start the program the value in the first column/row is
> highlighted and the HitTest doesn't retrieve a value if I click on that
> cell. Is there a way to get a datagrid to not highlight a cell - or are
> there any other ways to solve this?
>
> HitTest-code (simplified)
> Dim xInfo As DataGrid.HitTestInfo
>
> xInfo = Me.dgNames.HitTest(e.X, e.Y)
>
> MessageBox.Show(dgNames.Item(xInfo.Row, xInfo.Column))
>
>
> Thanks!
>
> Maria
>
>
>



Relevant Pages

  • Re: Text and Numeric lookup
    ... and also for the first cell reference in the formula. ... highlight the entire row containing the formulas ...
    (microsoft.public.excel.misc)
  • Re: Problem with HitTest in DataGrid
    ... I'm using HitTest to get a value from the cells into a textbox. ... Is there a way to get a datagrid to not highlight a cell - or are ... Dim xInfo As DataGrid.HitTestInfo ...
    (microsoft.public.dotnet.languages.vb)
  • Problem with HitTest in DataGrid
    ... I'm using HitTest to get a value from the cells into a textbox. ... Is there a way to get a datagrid to not highlight a cell - or are ... Dim xInfo As DataGrid.HitTestInfo ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Problem with HitTest in DataGrid
    ... that tells you how to make a grid have no active cell ... I'm using HitTest to get a value from the cells into a textbox. ... Is there a way to get a datagrid to not highlight a cell - or are ... Dim xInfo As DataGrid.HitTestInfo ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Is Blank
    ... Highlight those 140k cells, assuming the active cell is the first cell ... Special and then Blanks. ...
    (microsoft.public.excel.misc)