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.
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
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
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.
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?
Hi Mike,
I am using version 9.2 and it is not the latest service release. Will have to test it when I get the latest version.
I found a workaround, I reload the values into the columns valuelist (by calling the routine that loads the data into the column) right after loading the XML into the grid.
What version of the grid are you using? It says 9.2 in your XML here, but do you have the latest service release?
If the ValueList option is indeed working backwards, then that's clearly a bug. But I find that very hard to beleive and I know I have used this option recently and it worked fine for me.
Can you post a sample project demonstrating that not including the ValueList flag still saves the ValueLists and that including the flag does not save them? I can't get this to happen on my machine.
Hello All,
A funny thing, I call the SaveAsXml and LoadFromXml routines with the ValueLists option and the Valuelists do not get saved.
I get the following XML statement. (Is there a way I can get a patch to fix these bugs)
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.