Groups are removed from GridView when Docking is rearranged

1 Answer 23 Views
Docking GridView
Mike
Top achievements
Rank 1
Mike asked on 10 May 2022, 07:47 AM

Hi,

I have a WPF application that uses a RadGridView placed inside a RadPane. The RadGridView contains data that has fixed groups on multiple columns (groups are defined in XAML). The ItemsSource of the RadGridView is bound to an ObservableCollection so the UI gets updated as new data becomes available.

The grouping and display of data works as expected. However, as soon as I rearrange the RadPanel that contains the RadGridView all groups are removed an I'm left with a flat list. How can I regroup or keep the groups in the RadGridView after moving the RadPanel?

I have attached a sample project that demonstrates this behavior:

  1. Build and start the attached application
  2. Hit the red start-button on the UI to start generating data.
  3. Now the generated data gets grouped as expected.
  4. Drag & Drop the panel with the GridView to another location.
  5. All groups now disappear.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 12 May 2022, 02:54 PM

Hi Mike,

Thank you very much for the provided sample project and detailed instructions.

This issue is due to the fact that when you undock the pane, it is placed in a separate visual tree and its data context is temporarily lost. To resolve this issue, you need to set the DataContext of the RadPane containing the RadGridView explicitly:

<telerik:RadPane Header="Data" DataContext="{Binding}">

Please let me know if doing so resolves the issue at your end.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Mike
Top achievements
Rank 1
commented on 13 May 2022, 05:59 AM

Hi Dilyan,

Yes, that did the trick! Thank you!

Tags
Docking GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or