Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
detecting new column after calling UltraGridLayout.LoadFromXml
posted

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 

Parents
  • 469350
    Verified Answer
    Offline posted

     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. 

Reply Children