This is a migrated thread and some comments may be shown as answers.

Deselect doesn't fire SelectionChanging

1 Answer 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris Ward
Top achievements
Rank 1
Chris Ward asked on 09 Oct 2014, 07:45 PM
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?

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 14 Oct 2014, 12:57 PM
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.

 
Tags
GridView
Asked by
Chris Ward
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or