We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG Checkbox interaction

Thread ID:





29316 May 23,2005 03:14 PM UTC May 23,2005 03:47 PM UTC WinForms 2
Tags: GridControl
Stan Sajous
Asked On May 23, 2005 03:14 PM UTC

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. Thanks

Administrator [Syncfusion]
Replied On May 23, 2005 03:29 PM UTC

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
                Case 2
                    ''This is the trend line. Line above must be false
                    _grid(e.RowIndex - 1, e.ColIndex).CellValue = False
                Case 1
                    ''This is the actual data series.  Line below must be false
                    _grid(e.RowIndex + 1, e.ColIndex).CellValue = False
            End Select
        End If
        Me._grid.Binder.DirectSaveCellInfo = False
    End Sub

Administrator [Syncfusion]
Replied On May 23, 2005 03:47 PM UTC

Thanks! That worked great.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon