I'm using the Infragistics v9.2 and the ultrawingrid.DisplayLayout.SaveAsXml() routine to store the columns the user has selected to hide or show in the grid. This gives the benefit of maintaining a constant interface to the user. However when the columns are loaded from the XML file some unexpected results emerge.
Figure 1 - Original grid column layout.
I am using a grid which is bound to a datasource, and has two columns which are excluded from the column chooser. (The first 2 columns) I have my column chooser on a seperate dialog, when a change in made in this dialog the new layout is saved to the xml file. The xml files are loaded in the constuctor of my control.
Figure 2 - The column chooser without the excluded columns.
There are two columns which are hidden from the column chooser, these are a boolean column and an image column. Both have no caption, when the layout is loaded both columns show the key in the caption area. Also both of the hidden columns show up in the column chooser, even though they have been set to be excluded.
Figure 3 - The grid after loading the layout, with the keys in the header.
Figure 4 - Column chooser after loading the layout from the xml file showing the hidden columns.
Anybody have any thought on what could be causing this? Ideally I require the ability to save both the new locations of columns and the visibility.
Thanks
Sean
Hi Sean,
What options are you passing in to the SaveAsXml / LoadFromXml methods?
Did you check the ExcludeFromColumnChooser property on the two columns after you load the layout? What about the hidden property?
You might want to take a look at the actual XML that is written out and see if ExcludeFromColumnChooseris getting saved to the layout. If not, then the problem is with the save. If so, then the problem is with the load.
I was calling the routine like so
grid.SaveAsXml(filePath,PropertyCategories.All And Not PropertyCategories.ColumnFilters)
The excluding the columns is set at design time, I looked into the XML file and it had no details for the bands or columns. I have now changed the routine to only pass in the filepath and it works as expected. So it was something to do with the way I was using the Enum during the save method.