I'm trying to minimize the size of our persisted configuration for a XamGrid. At the moment the configuration is 3400 bytes big. I managed to shrink the size of the configuration by only persisting some properties that are necessary. For example I'm not saving all FilteringSettings but defined the PropertyPath to the properties I needed:
_settings.PropertySettings.Add(new PropertyNamePersistenceInfo { PropertyName = "FilteringSettings.FilterMenuSelectionListGeneration", Options = PropertyNamePersistenceOptions.PropertyPath });
We want to persist "Width" and the "IsSorted" properties of the columns. At the moment the configuration for these properties looks like this:
_settings.PropertySettings.Add(new PropertyNamePersistenceInfo { PropertyName = "Width", Options = PropertyNamePersistenceOptions.PropertyName }); _settings.PropertySettings.Add(new PropertyNamePersistenceInfo { PropertyName = "IsSorted", Options = PropertyNamePersistenceOptions.PropertyName });
Also in this case I want to switch to "PropertyPath" to specify exactly the property I need to persist. The mentioned properties are located in the "Columns" Collection. How can I define the property path such that I achive the behavior? I tried following but it isn't working:
_settings.PropertySettings.Add(new PropertyNamePersistenceInfo{PropertyName = "Columns[].IsSorted",Options = PropertyNamePersistenceOptions.PropertyPath});
Hello maxitservice,
Thank you for your post.
I have been investigating into this issue, and it appears that you are currently missing a small part of the PropertyName in your PropertyNamePersistenceInfo. The XamGrid does not currently have any means to directly save the Columns[].IsSorted and Columns[].Width properties. Instead, I would recommend that you use the following property paths:
ColumnLayouts[].Columns[].WidthColumnLayouts[].Columns[].IsSorted
This should save the column widths and IsSorted property in the XamGrid.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thank you. Solved the problem.
Thank you for your response. I am glad that my recommendations on this matter have worked to resolve this issue you were seeing.