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

Docking.LoadLayout clear collection of QueryableCollectionView.FilterDescriptions

3 Answers 131 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 07 Jul 2020, 09:53 AM

We have a WPF MVVM application.. use QueryableCollectionView for filtering items from two collections.

QCV created in VM... and also added FilterDescription to it.

RadGridView used QCV as ItemsSource.

View with RadGridView also used RadDocking and in Loaded handler there restore DockingLayout via call Docking.LoadLayout(fileStream)

We found that this operation affect on clear FilterDescriptions from QCV.

How it possible to avoid it?

3 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 10 Jul 2020, 08:37 AM

Hello Anton,

To avoid this, you can explicitly set the DataContext of the pane that holds the RadGridView control. You can do this in code:

this.pane.DataContext = theDataContextHoldingTheQCV;

Or in Xaml:

<telerik:RadPane DataContext="{Binding theDataContextHoldingTheQCV}">

I hope that helps.

Regards,
Martin Ivanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Andrey
Top achievements
Rank 1
answered on 04 Mar 2021, 11:06 AM

Hi Martin,

I've encountered with similar issue. I have RadGridView inside RadPane. Also I have regions navigation using Prism. When I switch back to the region that contains the Grid I see that all of the filters are deleted, 'scroller' moves to the beginning of the list (even if filtering wasn't set), but items from underlaying source collection (old observableCollection) are shown. Filters are set in UI, not in VM.

Previously I used to bind ObservableCollection to Grid and everything was ok (position of slider in grid was correct, filters were kept etc). But currently I use QCV and it seems that everything restores to default view. 

I've tried your suggested workaround, but after it even items are not shown in the Grid. Any other ideas how to solve this? 

 

BR,

Andrew

0
Martin Ivanov
Telerik team
answered on 09 Mar 2021, 09:32 AM

Hello Andrew,

I am afraid that without some sample code showing the setup I cannot tell what happens. What I can suggest you is to post few runnable code snippets here or open a new support ticket and send a project showing the issue. 

Regards,
Martin Ivanov
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/.

Tags
GridView
Asked by
Anton
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Andrey
Top achievements
Rank 1
Share this question
or