I'm using an UltraGrid in a WinForms application and calling UltraGridLayout.LoadFromXml to load the grid's ColumnFilters. I call LoadFromXml after setting the grid's DataSource property.
I also want to handle a new column in my data source. Since the new column isn't in the XML that I load, any formatting I do to the new column is lost once I load the XML.
Resetting the formatting after loading the XML works, but I'd rather not hard-code setting the formatting for this new column since I might have other new columns later and the user may change the formatting of the new column anyway (which would get saved to XML and loaded the next time the application runs).
Is there a way to detect that the new column is not part of the loaded XML ? Is it possible to compare the columns from the XML with the columns in the data source ?
Thanks.
Brad
Hi Brad,
One thing you could try it loading the XML layout into a layout variable instead of the grid's DisplayLayout. You can declare an UltraGridLayout object and then call it's load method to load the layout into it. You can then examine the bands and columns of the layout without loading it into the grid and compare the ones in the layout with the ones in the grid before you actually load the layout into the grid.
Hi Mike,
am looking for similar approach for finding new panes(with controls) in the ultraDockingManager. I created a new instance of ultradocking mgr and invoked LoadFromXML by converting dockinglayout xml contents of old version to stream and passing it . i thought i can compare what is in there in old layout docking mgr Vs current grid' docking manager BUT it threw me a obect reference exception.
ultraDockManager.LoadFromXML(ms);
can you please suggest me what am doing wrong?