You are right, it doesnt have the Row Change Event implicitly. You will most probably have to use either the CurrentCellChanged event or the Click event. There is a protected event also for row header clicks : RowHeaderClick
well, i think the datagrid in VB.NET for win app in .NET framework is a bit different. the datagrid current row change event is not there, so i have to write code to create the event myself. Anyway, thanks for the replies.
Datagridview is the advanced datagrid control in VS 2005. It should work in pretty much the same way. You will have to change the event args to the appropriate type.
How to catch the row change event in a datagrid?
Joe Bruce
Use the RowEnter or RowLeave event
Private Sub DataGridView1_RowEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowEnter
End Sub
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowLeave
End Sub
DataGridView1 is your DataGridView name.
Cleverp
Natallica
can any one else help me with this problem
Andrew Lloyd
Do you mean Datagrid by Datagridview Is it the same I tried to implement the code to my datagrid like this:
Private Sub DataGrid1_RowEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGrid1.RowEnter
Datagrid1 is my datagrid name.
But it does recognise the system.Windows.Forms.DataGridViewCellEventArgs and also the .RowEnter which is at the end of code.
I think the datagrid in win forms does have the RowEnter or RowLeave event.
Any comment
dops