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 Lee,
Could you be a bit more specific about what is getting saved that you don't want? The DisplayLayout.Save method cannot possibly save any data. The grid cannot save anything row or cell-related.
Perhaps what you need to do is use the Bands category, instead of All. This will save just the bands and columns and exclude things like sorting or filtering.
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