Hi,
I am using Infragistics2.Win.v9.2 and I am trying to save the properties of a grid except I do not want to save the valuelists as my values can change on a weekly basis and the users do not want to see the id of an object but the actual name.
I was using
.SaveAsXml(objStream, Infragistics.Win.UltraWinGrid.PropertyCategories.All)
And I tried
SaveAsXml(objStream, Infragistics.Win.UltraWinGrid.PropertyCategories.UnboundColumns)
and it gave me the same results as All.
The documentation for PropertyCategories is not that informative. So how can I do this? All I want to do is store the position of the columns and the sizing of each column so users can customize the grid to their preferences. And when they launch the app they then get the grid the way they want it.
Thanks.
Hello,
When I use Bands or UnboundColumns in saving and loading, ValueLists are saved and used. So it looks like we have a bug.
I even tried removing the ValueLists from the XML string, all that does is make that column display the ids instead of the corresponding name.
My next course of action is: when the app loads save the ValueLists and then after the user preferences are loaded, I will load the newly saved ValueLists overtop of the old ValueList. Hopefully this works.
Hi Mark,
Did you take a look at the help topic I linked above?
Some categories implicitly include others.The latest docs are much clearer and indicate which ones include which others.
UnboundColumns implicitly includes Bands. So if you have no actual unbound columns in your grid, then these two will behave the same.
In your case, either Bands or UnboundColumns should exclude ValueLists. So if your ValueLists are still getting saved/loaded, then that's probably a bug. Have you tried using the Bands category for both saving and loading? Or are you just testing the Save?
I just tried PropertyCategories.Bands and it saves the exact same information as PropertyCategories.All.
Looks like we have a bug in the software. Looks like for me in v9.2 if I use .All or .Bands or .UnboundColumns it returns me the same XML for all 3 options.
The documentation for the PropertyCategories enum has been updated in 10.3.
http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.3/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v10.3~Infragistics.Win.UltraWinGrid.PropertyCategories.html
you can combine the properties you want.
Actually in your case you need the property : Infragistics.Win.UltraWinGrid.PropertyCategories.Bands
you might want to combine it with Infragistics.Win.UltraWinGrid.PropertyCategories.AppearanceCollection
to keep the appearance of the grid
so the code is:
ultraGrid1.DisplayLayout.SaveAsXml(objStream, Infragistics.Win.UltraWinGrid.PropertyCategories.Bands|Infragistics.Win.UltraWinGrid.PropertyCategories.AppearanceCollection);
hope this helps