Hi!
I need to store some view info for my grid. So I use
grid1.DisplayLayout.SaveAsXml(stream, PropertyCategories.All);
But I realized that my ValueLists can be changed between store and load. Can I save my grid without ValueLists so they got refreshed automatically during Loading?
Mila.
Hi Mila,
I'm pretty sure that one of the PropertyCategories is ValueLists. So you can exclude these from the saving and loading easily enough by just removing the flag.
Another option is to simply load the layout before you assign your ValueLists to the grid.
The problem is: if I exclude ValueLists flag from PropertyCategories then ValueLists didn't saved. But after loading view from XML my ValueLists are all cleared - no ValueLists at all so I should load ValueLists again.
I have a lot of ValueLists loading from DB and it takes some time. If user adds new value to ValueList then I just update my ValueList and that's all. I am not asking DB and not reloading all my ValueLists cause I know where this value came from. User has several different views of the table with different visible columns and he can switch between those views. I store views as XML. So now if user added some value to ValueList and then changed his view I should go to DB and reload all my ValueLists - it takes a lot of time and it is unnecessary cause all ValueLists are correct before loading from XML. So I was thinking may be I can store all ValueLists somehow before loading XML and then load it from memory. It should be faster than go to DB every time user changes his view. Please advice how to store/load ValueLists to memory if there is no other way to prevent ValueLists from XML loading.