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?
Hi,
There's really not enough information here for me to guess what you need help with.
Where are you getting a NullReferenceException?
My requirement is to apply user's existing dock layout to th new layout in our code ( mainly hiding tabs,...) . this is wat am doing for that. i have dock layout xml portion of that user's layout.
UltraDockManager
prfDockManager = new UltraDockManager
();
using
{
}
t))
My Null Refrence Exception - Stack Trace :
===================================
at Infragistics.Win.UltraWinDock.UltraDockManager.InvalidateUnpinnedTabAreas(Boolean dirtyChildElements, Boolean recalculateSize) at Infragistics.Win.UltraWinDock.UltraDockManager.Load(Stream stream, Boolean xml) at Infragistics.Win.UltraWinDock.UltraDockManager.LoadFromXML(Stream stream) at Intel.IDMS.Forecast.Analysis.Client.Util.GridHelper.LoadDockLayout(UltraDockManager ultraDockManager, String layout) in
I've never heard of that error message, before, but I'm afraid DockManager isn't really my area of expertise.
If you can post a small sample project demonstrating the exception, we can certainly look into this for you and see what's going on.
Or, you might want to try posting on the DockManager forum and see if someone there has heard of this.
Another option would be to get the latest service release and see if this is a bug that is already fixed. It seems like this is probably a bug, since all you are doing here is loading a layout and that should never blow up - unless there is other processing going on here that you did not post.