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
1160
New SaveCustomizations/LoadCustomizations methods
posted

Hi!

I've been trying to use the new save/load customizations methods and don't understand how they interact with statically defined grid settings, especially widths.  First of all, despite the doc that states that widths are saved I'm not seeing them in the xml e.g.

 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<xamDataPresenter version=\"8.2.20082.1002\">\r\n  <fieldLayouts>\r\n    <fieldLayout key=\"Policies\">\r\n      <sortedFields>\r\n        <sortedField direction=\"Ascending\" fieldName=\"LastModifiedBy\" isGroupBy=\"false\" />\r\n      </sortedFields>\r\n      <fields>\r\n        <field name=\"IsLocked\" row=\"0\" column=\"0\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"InsuredName\" row=\"0\" column=\"4\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"ProductName\" row=\"0\" column=\"3\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"Number\" row=\"0\" column=\"7\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"PolicyPrimaryStatus\" row=\"0\" column=\"5\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"InceptionDate\" row=\"0\" column=\"2\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"ExpirationDate\" row=\"0\" column=\"6\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"LastModifiedBy\" row=\"0\" column=\"1\" rowSpan=\"1\" columnSpan=\"1\" />\r\n        <field name=\"LastModifiedDate\" row=\"0\" column=\"8\" rowSpan=\"1\" columnSpan=\"1\" />\r\n      </fields>\r\n    </fieldLayout>\r\n  </fieldLayouts>\r\n</xamDataPresenter>"

 Probably because of this when loading the saved customization the default statically defined grid settings are being used.  I define the xamDataGrid with  FieldLayoutSettings.DataRecordCellAreaGridTemplate / ItemsPanelTemplate that defines a Grid with ColumnDefinitions that have various widths meant for the initial definition of the xamDataGrid. 

How do I get this thing to save & restore the widths?  What overrides what or is there a specific point that the saved customization must be loaded for it to take effect?  I've tried both after InitializeComponent and in the Grid_Loaded event and only the column order and sort order are affected, the column widths are those defined in the ItemsPanelTemplate/Grid.

Any help in understanding the impact of the various combinations of xamDataGrid properties will be appreciated.  I'm enclosing my xaml if it helps.

Thanks!

Glenn

xamDataGrid.zip
Parents
  • 415
    posted

    Hi,

    I took a look at the XAML you attached and played around with a couple settings to see what was causing xamDataGrid not to save width information. From my initial tests, the culprit seems to be the AutoFit property. When I set the AutoFit property is to False, the width of the fields take on the dimensions you set in XAML. Any modifications to the widths at run time are then persisted out in XML format when I call the SaveCustomizations method.

    I would suggest opening a case with Developer Support so they can investigate this issue. Please mention the initial findings that suggest that the AutoFit property is interfering with persisting a field's width.

    You can log an issue by copy/pasting the following link in your browser: http://es.infragistics.com/support/submitrequest.aspx

     

Reply Children
No Data