Hello,
i'm using the save and load method of the grid(also tried with savexml and loadxml) to save the layouts on files. I dont understand why the save method saves also the valuelists in the file? valuelist may change because for example they are generated from other data so they are not static.
The problem is that if i save the layout without the valuelist and than load the layout, the grid loose the valuelist(and i see the data) even though the are generated at ultraGridContatti_InitializeLayout event.
Any idea how to fix this?
Is there a tool that converts from xml layout to non xml layout and viceversa?
Thank you.
You can't trigger the event. What I would do is take the code that is creating and attaching the ValueLists out of the InitializeLayout event and put it into a method. Then you can call that method from InitializeLayout and from anywhere else you need.
Hi Mike,
let me explain the problem with an example.
A ultragrid on a user control. On the initiliaze_layout event of the grid, create the valuelist and attach it to a column. Save the layout without the valuelist. Load the layout saved before and boom the valuelist are gone! I dont like this behaviour(the grid resets the valuelist).
You suggest to recreate the valulist after loading a layout. The problem is that i have only a reference to the UltraGrid instance. How can i trigger the initialize_layout event after a loading the layout?
Hi Walter,
I'm not sure what the problem is. The grid saves the ValueLists because they are properties on the column and they are therefore part of the layout. If you don't want this, then do not include the ValueLists flag in the PropertyCategories you specify to the save method.
Of course, if you don't save the ValueList, then they won't be there when you load. So you will have to re-attach the correct ones you want in code after calling the Load method.