Datagrid events

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

Guest

I wish to know which datagrid event is called when I save data the data on my datagrid by clicking the little pen. The
Mydatagrid_currentcellchanged event seems to be called just by clicking on the grid without changing anything. The grid is bound to a dataset called mydataset. The reason I wish to know this is because the I need to call 2 procedures when the datagrid details are changed each one updating the same database table and this is currently causing concurrency problems

Please hel

Rober
 
Hi,

I dont know of any event that fires when you click on the pen. You
check to see if the user clicked on the row header in the click event and
run your procedures if there is changes to the data.

Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Click

Dim pt As Point = DataGrid1.PointToClient(Cursor.Position)

Dim hti As DataGrid.HitTestInfo

hti = DataGrid1.HitTest(pt)

If hti.Type = DataGrid.HitTestType.RowHeader Then

If ds.Tables(0).GetChanges.Rows.Count > 0 Then

MessageBox.Show("Changes")

End If

End If

End Sub



Ken
 
Back
Top