User (Old forums)MemberFebruary 28, 2007 at 12:23 pmPost count: 23064
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)MemberMarch 1, 2007 at 1:32 pmPost 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
Imported from legacy forums. Posted by John (had 597 views)User (Old forums)MemberMarch 1, 2007 at 3:07 pmPost 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)MemberMarch 1, 2007 at 3:51 pmPost 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.
Imported from legacy forums. Posted by John (had 3576 views)User (Old forums)MemberAugust 12, 2008 at 1:23 amPost 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
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!!
Imported from legacy forums. Posted by Debi (had 388 views)User (Old forums)MemberAugust 12, 2008 at 4:27 pmPost 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)
- You must be logged in to reply to this topic.