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

Persistence Framework with Multiple RadGridview

2 Answers 152 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Aamir
Top achievements
Rank 1
Aamir asked on 15 Nov 2011, 10:36 AM
GridViewSerialization example works fine as long as we have 1 gridView .In my case , i have TreeView and each treeviewitem is having
one gridview. Its something like that :

 <telerik:RadGridView x:Name="RadGridView1"  telerik:PersistenceManager.StorageId="RadGridView1".
<telerik:RadGridView x:Name="RadGridView2"  telerik:PersistenceManager.StorageId="RadGridView2".
<telerik:RadGridView x:Name="RadGridView3"  telerik:PersistenceManager.StorageId="RadGridView3".


After Saving Sorting on each grid , when i try to load then it gives me "null exception" for column . If you can extend your example of 
GridViewSerialization with multiple gridview then you can reproduce this issue.

2 Answers, 1 is accepted

Sort by
0
Aamir
Top achievements
Rank 1
answered on 15 Nov 2011, 12:39 PM
I think i solved it by using if (column != null).

  if (column != null)
                    {
                        gridView.SortDescriptors.Add(new ColumnSortDescriptor() { Column = column, SortDirection = proxy.SortDirection });
                    }
0
Alex Fidanov
Telerik team
answered on 16 Nov 2011, 09:42 AM
Hi Aamir,

It seems that when loading, the saved column info cannot resolve its actual column in the GridView. It could be that the columns of the GridView have not already loaded or the column does not exist in the GridView. You can troubleshoot this with the custom provider class and check whether all of the GridView columns are loaded when the sort descriptors are being restored.

Kind regards,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
PersistenceFramework
Asked by
Aamir
Top achievements
Rank 1
Answers by
Aamir
Top achievements
Rank 1
Alex Fidanov
Telerik team
Share this question
or