DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to raise an event by clicking on a row within a dataGrid using
the compactframework?
 
Any row. We're developing a warehouse application and the datagrid will be a
snapshot of the lines for a sales order. I need the user to be able to
select a line and when they do it needs to raise an event or I can have them
click a button and run something based on what row is highlighted within the
datagrid.
 
An event that I use to detect clicks on rows is myDataGrid_mouseDown.

if you then create a HitTestInfo object you can use it to determine which
row was clicked on. i.e. :

Private Sub myDataGrid_MouseDown.....
Dim myHitTest As DataGrid.HitTestInfo

myHitTest = dgLabour.HitTest(e.X, e.Y)

MessageBox.Show(myHitTest.Row)
--------------------------------------------------------

Is this what you meant/needed?
Ross
 
That will do it. Thanks

Ross May said:
An event that I use to detect clicks on rows is myDataGrid_mouseDown.

if you then create a HitTestInfo object you can use it to determine which
row was clicked on. i.e. :

Private Sub myDataGrid_MouseDown.....
Dim myHitTest As DataGrid.HitTestInfo

myHitTest = dgLabour.HitTest(e.X, e.Y)

MessageBox.Show(myHitTest.Row)
 
Back
Top