B
Brian Tkatch
How do i detect a datagrid row change?
Currently, i have a few datagrids that i keep in sync, refreshing from
the database whenver a row changes. I would like to avoid
CurrentCellChanged because changing a cell within the same row causes
an uneccesary DB call. Also, when the row changed to is the "new" row,
nothing should happen.
I wrote some code, which indeed works, but would like to know if i am
missing something more obvious.
When a grid is Fill()ed, it stores count in a variable like
Grid_Row_Count = Data_Set.Tables([table_name]).DefaultView.Count
Private Sub Grid_CurrentCellChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Grid.CurrentCellChanged
Static Current_Row As Integer
If Grid.CurrentRowIndex = Current_Row _
Or Grid.CurrentRowIndex = Grid_Row_Count Then Exit Sub
Current_Row = Grid.CurrentRowIndex
Fill_Child_Grid()
End Sub
B.
Currently, i have a few datagrids that i keep in sync, refreshing from
the database whenver a row changes. I would like to avoid
CurrentCellChanged because changing a cell within the same row causes
an uneccesary DB call. Also, when the row changed to is the "new" row,
nothing should happen.
I wrote some code, which indeed works, but would like to know if i am
missing something more obvious.
When a grid is Fill()ed, it stores count in a variable like
Grid_Row_Count = Data_Set.Tables([table_name]).DefaultView.Count
Private Sub Grid_CurrentCellChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Grid.CurrentCellChanged
Static Current_Row As Integer
If Grid.CurrentRowIndex = Current_Row _
Or Grid.CurrentRowIndex = Grid_Row_Count Then Exit Sub
Current_Row = Grid.CurrentRowIndex
Fill_Child_Grid()
End Sub
B.