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

Problem with Raise GridView SortingEvent after restore via PersistenceManager

0 Answers 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hamid
Top achievements
Rank 1
hamid asked on 04 Apr 2012, 09:55 AM
Hi

I have form include GridView that user can change column visibility, size, sort, etc. and then save layout using PersistenceManager.
Because I implement custom paging, in Sorting event, i get sorted data from server.
all process work fine. but when restore layout using PersistenceManager, Column that user already sorted on it restore and data sorted in local mode, not server mode.

Therefore if GridView Sorting event raise automatic or manual after restore layout, my problem will be solved.

Note: I also using below code, but not work:
lstGridView.ForEach(p =>
{
         if (p.SortDescriptors != null && p.SortDescriptors.Count > 0)
         {
                 p.RaiseEvent(new GridViewSortingEventArgs((p.SortDescriptors[0] as ColumnSortDescriptor).Column, SortingState.None, SortingState.Ascending) {
                                            RoutedEvent = RadGridView.SortingEvent,
                                            Source = this
                  });
          }
});

Could you please help me.

No answers yet. Maybe you can help?

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