Home Forums WPF controls Xceed DataGrid for WPF three clicks to edit a checkbox

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

    Hi

    I’ve got a grid that has a ItemSource-collection with a property called “Add” (boolean). The grid shows this as a column with checkbox-cells. Perfect so far, but the user has to press the checkbox three times to set it to checked/unchecked. Here is what I think happens:

    First click: The row is selected
    Second click: Not sure, but I think the cell is set to inEdit mode.
    Third click: The checkbox is set to checked.

    So my question is how do I set the checkbox to “Checked” or “Unchecked” in one click?

    Thanks in advance,
    Martin

    Imported from legacy forums. Posted by krogh (had 4471 views)

    User (Old forums)
    Member
    Post count: 23064

    have a look at CellEditorDisplayConditions and EditTriggers. You can set the grid so that it is always in Edit mode. There is also MouseOverCell and/or MouseOverRow.

    Imported from legacy forums. Posted by Jack (had 406 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi

    Thanks for the reply.

    I’ve tried to experiment with the edittrigger property, and are now down to two clicks to edit a checkbox (one to go 🙂 ). I’ve set the edittrigger property to SingleClick. Seems like it still needs one click to select the row (or cell? ) and one click to set the value of the checkbox

    /Martin

    Imported from legacy forums. Posted by krogh (had 406 views)

    Xceed Support
    Member
    Post count: 5658

    You can set the “CellEditorDisplayConditions” property on the Column or on the DataGridControl. Displaying the Editor on the MouseOverCell, MouseOverRow or Always will ensure that the “first” click will be on the editor instead of on the viewer.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 273 views)

    User (Old forums)
    Member
    Post count: 23064

    Could you skip the editor and just use the checkbox in the cell template to do the editing?

    Imported from legacy forums. Posted by MiddleTommy (had 408 views)

    Xceed Support
    Member
    Post count: 5658

    You could, but doing so would “forfeit” the built-in edition/cancellation mechanism…

    If your column always need to be “immediately” editable, then I advise setting the Column’s CellEditorDisplayConditions to Always.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 266 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks a lot. I’ve set the CellEditorDisplayConditions to Always, and now the user only has to press the checkbox once.

    /Martin

    Imported from legacy forums. Posted by krogh (had 5480 views)

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