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
130
LoadCustomizations does not apply settings on XamDataGrid with dynamically added columns
posted

(This may be related to http://ko.infragistics.com/community/forums/p/56268/296411.aspx but I need a solution.)

Hi,

we have a XamDataGrid with dynamically added columns (the column definition is served by the back end and may vary). When the column definition changes it's ok when the layout is not applied. But the saved layout must be loaded when the column definition has not changed.

The columns are added like this (simplified):

UnboundField field = new UnboundField();
field.Name = "colname";
field.Label = "col display name";
field.BindingPath = new PropertyPath(bindingPath);
grid.DefaultFieldLayout.Fields.Add(field);

Adding the columns takes place after the control has been initialized and works great - no issues there.

Now after adding the columns I run the LoadCustomizations with a settings string that contains the grids layout with the exact same field list including the dynamic columns from a previous front-end session - but unfortunately the settings do not apply!

this.BookingsGrid.LoadCustomizations(this.bookingsGridCurrentSettings);

The strange thing is that when I run the same settings via a command (in application menu), the settings are applied - the difference there is, that I have to run it in the Loaded-event of the grid to apply. The loaded event then is fired because the parent control is doing some refreshing.

Any suggestions?

As a workaround I guess it'd be also possible to move the LoadCustomizations to the loaded event but it doesn't fire. What is the best way to force the reload of the control?

----

Edit: Using Version 11.2.20112.2125
And I just checked again - the settings string is exactly the same for the manually triggered layout loading compared to the LoadCustomizations after setting the dynamic columns.