Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
Adressing Property in Collection
posted

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
});

Parents
  • 34830
    Verified Answer
    Offline posted

    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[].Width
    ColumnLayouts[].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,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Reply Children
No Data