Home Forums WinForms controls Xceed Grid for WinForms Three State and Unbound Checkbox in a Bound Grid

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15145 |

    Hello,

    I have a GridControl that is bound, but I’ve added an unbound checkbox so users can select a record. By default, the selection checkbox is set for three state, which requires users to click each record twice to select it. Ideally, I’d like to turn off three state. Should I be using GridCheckBox or the column’s CellView Manager with casting? Could anyone show me an example?

    Thank you for your help.

    Imported from legacy forums. Posted by John (had 3318 views)

    User (Old forums)
    Member
    Post count: 23064

    Here’s what I’ve been able to narrow it down to. It still doesn’t work because the grid’s Select checkbox opens up to the Indeterminate state and the user must click each checkbox twice to select a record (my goal is just a single click). SingleClickEdit doesn’t seem to do anything.

    Dim checkbox As New WinCheckBox()
    checkbox.ThreeState = False
    checkbox.CheckState = CheckState.Unchecked

    Dim manager As New Editors.CheckBoxEditor(checkbox)
    GridControl1.Columns(“Select”).CellEditorManager = manager

    Thanks again.

    Imported from legacy forums. Posted by John (had 597 views)

    User (Old forums)
    Member
    Post count: 23064

    This is normal since the underneath value is still NULL. What you could do is set each cell to false if you want it to be false by default, using a foreach or a for.

    Adding a checkbox editor to a boolean column will not set a value by default (besides NULL).

    Imported from legacy forums. Posted by Matt (had 246 views)

    User (Old forums)
    Member
    Post count: 23064

    Just like me to try to find an easy way when there is none. Looping throw to set the null state to false is a problem for large datasets, so I guess I’ll have to limit the number of rows returned from any query to 500 or less.

    I would appreciate it if you would please consider adding “Three State” as a property to the grid or the checkboxeditor/viewer with False answers toggling the checkbox to a false state.

    Thank you again for your help. I appreciate it very much.

    John

    Imported from legacy forums. Posted by John (had 3576 views)

    User (Old forums)
    Member
    Post count: 23064

    I have a similiar situation with a similar result as the previous poster.  I have also set SingleClickEdit = True.

    In my case my record set has already returned a value of 0 for the check box column.  I also tried using a for each as follows to explicitly set the value:

     For Each row In fgrid.gridControl1.DataRows

       row.Cells(“select”).Value = 0

    Next

    What is also interesting is that the first row seems to work fine (I can single click the checkbox and it’s checked), but all other rows when I single click a check is briefly displayed and then disappears.  I must click a second time to get it checked.  Also when I click the first time the checkbox gets a grey background after the check disappears, then the second time it’s a normal white background and stays checked.

    My version of the Xceed Grid is 2.5…sorry it’s part of a scripting language built in to the application I’m using so there’s no option to update it.

    Thanks in advance for any help!!

    Debi

     

    Imported from legacy forums. Posted by Debi (had 388 views)

    User (Old forums)
    Member
    Post count: 23064

    This is a quite old version, so it is difficult to say.  But are you using a different instance for your CheckBox for both the CellEditor and CellViewer?  If not, it may explain the issue.

    Imported from legacy forums. Posted by André (had 1011 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.