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

Selected Cells and Sorting/Grouping in RadGridView

0 Answers 208 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andree
Top achievements
Rank 1
Andree asked on 22 Apr 2021, 01:09 PM

Hi,

it took me a while to find out the actual behavior of the GridView, but I think I got and now and would just like to point out a misleading example and ask if I've misunderstood something.

When attaching to the RadGridView.SelectedCellsChanged-event, I get the following behavior:

1.  When a complete row was selected and the grid is sorted/grouped, I receive a SelectedCellsChanged-event with the newly added cells (all cells of the row). However, the GridViewSelectedCellsChangedEventArgs do not contain the removed cells. Is this by design because the removed GridViewCellInfo-instances are no longer part of the updated grid?

2.  When only single cells were selected and the grid is sorted/grouped, the selection of these cells seem to be cleared. However, I do not receive a SelectedCellsChanged-event. This is okay for me, as I can still listen to

  • the RadGridView.Sorted-event 
  • the RadGridView.Grouped-event

and clean up my ViewModel-CellSelection there. But this leads to the misleading example "Grid View - Selection" in the WPF Controls Examples suite. Here, the SelectedCellsBindingBehavior.cs only listens to the SelectedCellsChanged-event, which results in cells still being listed in the "Selected cells:"-Listbox of the example after a sorting operation, although they are no longer selected.

 

Greetings,

Andree

 

 

Dilyan Traykov
Telerik team
commented on 27 Apr 2021, 12:28 PM

Hello, Andree,

I can confirm that I was able to replicate the behavior you described and it is not very intuitive even though it seems to be the case by design. I will discuss this with our development team and update you as soon as I have more information on the matter. We will also consider updating the example which you referenced. 
Dilyan Traykov
Telerik team
commented on 29 Apr 2021, 02:06 PM

Thank you for your patience.

We can confirm that this is a bug at our end and I have thus logged the following bug report in our feedback portal regarding it on your behalf. As a thank you for bringing this to our attention, I've awarded you with some Telerik points.

Please follow the feedback item to get notified about any changes in its status. I do hope you can achieve the desired result by handling the Sorted and Grouped events for the time being.

Andree
Top achievements
Rank 1
commented on 29 Apr 2021, 06:04 PM

Hi! Thanks for the update and the created bug. Yeah, we can work around this with the events mentioned above. Adding this to the SelectedCellsChanged-event would be appreciated of course, as it was a small pitfall at least for me.

Greeting,

Andree

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Andree
Top achievements
Rank 1
Share this question
or