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

Save and Restore Gridview settings with new Silverlight 5 binaries

2 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
danparker276
Top achievements
Rank 2
danparker276 asked on 17 Feb 2012, 08:23 PM
I noticed the online documentation link doesn't work anymore
http://www.telerik.com/help/silverlight/radgridview-how-to-saveload-gridview-layout.html

When moving the to the new binaries the old code breaks. Somethings are mentioned in the Breaking Changes thread, but somethings are not.

SortDirection wasn't covered in the thread, I guessed:
IColumnFilterDescriptor columnDescriptor = (from c in grid.Columns.OfType<GridViewBoundColumnBase>()
            where c.GetDataMemberName() == setting.PropertyName
            select c).FirstOrDefault().ColumnFilterDescriptor;
columnDescriptor.SuspendNotifications();
columnDescriptor.Column.SortingState = SortListToSettings(setting.SortDirection);
columnDescriptor.ResumeNotifications();


FieldFilter.Filter1.Member doesn't work anymore, I guessed to remove it:

                                IColumnFilterDescriptor cfd = matchingColumn.ColumnFilterDescriptor;
                                cfd.SuspendNotifications();
                                if (setting.Filter1 != null && setting.Filter1.Member != null)
                                {
                                    cfd.FieldFilter.Filter1.Member = setting.Filter1.Member;
                                    cfd.FieldFilter.Filter1.Operator = setting.Filter1.Operator;
                                    cfd.FieldFilter.Filter1.Value = setting.Filter1.Value;
                                }
...
cfd.ResumeNotifications();

also, this doesn't work
 FilterSetting setting = new FilterSetting();
 setting.PropertyName = cfd.Column.DataMemberBinding.Path.Path;


Are these ok?  Are you going to replace the documentation on how to restore settings?
Maybe alll of those functions have to be re-written, but I don't have time to do that right now. I was wondering if there are some quick fixes.

2 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 20 Feb 2012, 07:48 AM
Hello Dan,

Actually, the current suggested approach is to work with RadPersistenceFramework. Please refer to our demos for a reference.
 

Kind regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
danparker276
Top achievements
Rank 2
answered on 21 Feb 2012, 08:52 PM
Thanks the RadPersistenceFramework is much better.
Tags
GridView
Asked by
danparker276
Top achievements
Rank 2
Answers by
Maya
Telerik team
danparker276
Top achievements
Rank 2
Share this question
or