Home Forums WinForms controls Xceed Grid for WinForms Grid behaviour on Click

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

    I have a grid where the first column is checkboxes. When clicking a checkbox cell it is checked/unchecked as expected. My issue though is this:

    When I have selected (not checked) multiple rows with click – shift + click I would like to be able to click one of the checkboxes and the checkboxes of ALL the selected rows should be toggled, without the row selection updating. The problem is that as soon as a row is clicked the selected rows are updated to contain only the clicked row. I have verified this with a Cell.Click event.

    Is there anyway to trap the click and get the collection of selected rows before they are deselected?

    The worst case solution I guess would be to set selectionMode to None and code the selection logic myself by putting Cell.Click events on all cells. Was hoping I dont have to do that 🙂

    Imported from legacy forums. Posted by Tomas (had 2584 views)

    User (Old forums)
    Member
    Post count: 23064

    You could try the MouseDown event, which is fired before the Click event.

    Imported from legacy forums. Posted by Tommy (had 131 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for the tip. I just tried, but it seems the SelectedRows property is updated to contain only the clicked row even before this event fires too!

    I messed around with IsSelectedChanged too and think I found a bug. I tried this in IsSelectedChanged:

    private void row_IsSelectedChanged(object sender, EventArgs e)
    {
    ((Row)sender).IsSelected = true;
    }

    If I click a few rows (not using shift or control) it appears all the rows stay selected (they have the highligt color) BUT if I check the SelectedRows properties of the grid it only contains ONE row. The one I clicked last.

    Imported from legacy forums. Posted by Tomas (had 3484 views)

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