Hi
I'm trying to save my grid settings to XML by using
Sender.DisplayLayout.SaveAsXml(oStream, Infragistics.Win.UltraWinGrid.PropertyCategories.All) (Sender is an object equating to the grid) Trouble is, is that by using .ALL it is causing me some grief when it comes to using a different database connection as it's producing some very strange results when I point it at a different database.
Basically I have one WinClient .exe that can access a wide range of databass (the databases are all the same structural wise but differ in data - they are customers data in effect and one database per customer)
Basically all I want to be able to save is the columns within the grid, minus data, the position of the column and it's size. with the .ALL in play it is also savng some data in specific cases and also data is saved if we have any value lists within the grids.
If somebody could point me in the right direction I would appreciate it
Thanks
Lee
Hi,
Well.. the saved layout only includes things that have actually changed - but by that I mean things that have changed from the default values in the grid - not neccessarily things that the user changed.
There's nothing built-in to the grid to give you just what has been changed from a certain point. I suppose if you wanted to work at it, though, you could save your "default" layout when the grid is initialized. Then you could save the layout again later and write a routine to string out anything in the XML that is duplicated.
Then when you go to load the layout, you would have to do the same thing, start with the "Default" layout and add in the changes.
This would not be easy, though and I'm not sure if it's really feasible to manipulate the XML like that. It would be very tricky and there's a big potential for corruption of the XML.
Another option you might consider is to specify which layout options you want to save. If you know, for example, that the users cannot change the filters, then you can remove those from the saving and loading of the layouts.
Hi Mike,
I have requirement to save the grid settings to the Sybase database, and Sybase doesn’t supports to pass the entire settings XML to Stored Procedure as input parameter to save it, which is pretty huge to save as well, is there any way to save those setting which are changed..?to avoid save the entire xml to save
At present my setting xml size is 35 KB... J,
Mike
Excellent!! Many thanks for your help!! I'm sure we can work that one out from here in!
Many thanks once again
Hi Lee,
Okay, that makes sense. The ValueLists are saved as part of the layout when yuo specify All.
The Bands category basically means the columns and their positions and sizes. So I would recommend trying that. The categories enum is a flags enumeration, so you can pick and choose which parts of the layout you want and OR them together. I'm pretty sure there is a ValueLists option, too. So you might even want to specify All and not ValueList.
Hi Mike
I think my development team got a little over excited at what it was saving. Having sat down with them, in terms of data being saved, what is being saved is the data within a value list that we have within the Grid. For instance, I have a grid with a value list that reads from a file to populate. Once I go through a piece of code that fires the DisplayLayout.SaveAsXml(oStream, Infragistics.Win.UltraWinGrid.PropertyCategories.All) code it does appear to save the contents of the value list. I can reproduce this by addign a value to the file that the value list should reference and not see it populated. I don't know if this is a timing issue within code in so much of the fact that we load the value list from file, then load the grid properties which overwrites the values in the value list but it certainly appears as if the value list is cached and I can solve the problem by removing my XML files that have been saved.
Somebody has mentioned the bands cateogory but havign read the help files on them, they weren't all that clear. I want to be able to save the Columns, their size and position within the grid.
Thanks very much for your help