Re: Problem with HitTest in DataGrid
From: Maria Anthonsen (mariant_at_INGENSPAMstart.no)
Date: 12/15/04
- Next message: Nak: "Re: UpdateResource being weird"
- Previous message: Jim: "Re: Stopping vb services"
- In reply to: Ken Tucker [MVP]: "Re: Problem with HitTest in DataGrid"
- Messages sorted by: [ date ] [ thread ]
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
>
>
>
- Next message: Nak: "Re: UpdateResource being weird"
- Previous message: Jim: "Re: Stopping vb services"
- In reply to: Ken Tucker [MVP]: "Re: Problem with HitTest in DataGrid"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|