Deselect doesn't fire SelectionChanging

2 posts, 0 answers
  1. Chris Ward
    Chris Ward avatar
    54 posts
    Member since:
    Jan 2010

    Posted 09 Oct 2014 Link to this post

    Note: SelectionMode is "FullRowSelect".

    Example:
    Let us assume the user has 3 rows selected and the "CurrentCell" is the second cell on the third row.

    If the user holds Ctrl and clicks the second cell of the third row (still CurrentCell), then the third row will be deselected (highlight goes away).

    However, mygrid.SelectedRows.Count is still 3 and SelectionChanging does not fire!

    If the user had instead held Ctrl and clicked any other cell in the third row, the visual update is the same but the grid will additionally fire the SelectionChanging event and SelectedRows.Count will be 2, as expected.

    This seems like a bug, how can I make this functionality be made more intuitive for the end user?
  2. George
    Admin
    George avatar
    500 posts

    Posted 14 Oct 2014 Link to this post

    Hi Chris,

    Thank you for writing.

    I can confirm that the SelectionChanging/Changed events are not being fired in the described scenario, however the amount of SelectedRows is properly updated. You can see that by running a Timer which every few milliseconds writes the amount of selected rows to the console. I have logged the issue here: UI for Winforms Feedback Portal - FIX. RadGridView does not fire the SelectionChanging event when a selected cell is clicked with Ctrl being held.

    As a workaround, you can subscribe to the PropertyChanging event of each row:
    this.Grid.Rows.ToList().ForEach(x => x.PropertyChanging += x_PropertyChanging);
    ....
    void x_PropertyChanging(object sender, Telerik.WinControls.Interfaces.PropertyChangingEventArgsEx e)
    {
        if (e.PropertyName == "IsSelected")
        {
            Console.WriteLine("CHANGING");
        }
    }

    I have updated your Telerik Points for reporting this.

    Do not hesitate to let me know, should you have further questions.

    Regards,
    George
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top