I have a GridDataBound grid where rows are paired, I need to have a blank line between each pair of rows and checkboxes to select only one row from each pair. I have code in place to uncheck the other checkbox in a pair when one is checked, but somehow it will also uncheck all other checkboxes in the grid.
I have noticed that if I check a box then give focus to a couple non-checkbox cells before checking another checkbox in a different pair then it will behave as intended.
I''ve attached a Sample Project that illustrates this issue.
ADAdministrator Syncfusion Team May 23, 2005 10:29 AM
Thank you for your sample.
To make sure the changes you are directly setting in the checkboxclick event are saved, try setting the grid.Binder.DirectSaveCellInfo property while you make the change.
Private Sub _grid_CheckBoxClick(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs) Handles _grid.CheckBoxClick
Dim modulo As Integer
Dim newCheckValue As Boolean
''Check box does not reflect change from click yet, so we have to invert it''s value
newCheckValue = Not CBool(_grid(e.RowIndex, e.ColIndex).CellValue)
Me._grid.Binder.DirectSaveCellInfo = True
''checkboxes are always in pairs, when one is checked, it''s counterpart must be unchecked.
If newCheckValue Then
modulo = e.RowIndex Mod 3 ''Each set of data series is 3 rows, Actual, Trend and Blank
Select Case modulo
''This is the trend line. Line above must be false
_grid(e.RowIndex - 1, e.ColIndex).CellValue = False
''This is the actual data series. Line below must be false
_grid(e.RowIndex + 1, e.ColIndex).CellValue = False
Me._grid.Binder.DirectSaveCellInfo = False
ADAdministrator Syncfusion Team May 23, 2005 10:47 AM