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
675
WinGrid Layout changes from 7.3 to 9.2
posted

I have recently upgrade my solution from Infragistics 7.3 to 9.2 (9.2.20092.1003).

I use  the following code to save the grid layout to a database table:

 

 

 

 

 

MemoryStream XMLStore = new MemoryStream();

System.Text.

UTF8Encoding enc = new System.Text.UTF8Encoding();

 

 

this.dgQueryResult.DisplayLayout.SaveAsXml(XMLStore);

 

 

string strLayout = enc.GetString(XMLStore.GetBuffer());

And this code to read the string and apply it to the grid.

 

 

 

 

 

 

MemoryStream XMLStore = new MemoryStream();

System.Text.

UTF8Encoding enc = new System.Text.UTF8Encoding();

strLayout = dsTmp.Tables[

"QUERY_FILTER"].Rows[0]["QUERY_LAYOUT"].ToString();

 

 

if (strLayout.Length > 0)

{

XMLStore.Write(enc.GetBytes(strLayout), 0, strLayout.Length);

XMLStore.Position = 0;

 

 

this.dgQueryResult.DisplayLayout.LoadFromXml(XMLStore);

}

This worked fine in previous versions and will work now if I save the layout using v9.2.

However, if I attempt to load a layout in 9.2 that was saved with the code at 7.3, I get the following exception on the LoadFromXml line:

"Object reference not set to an instance of an object."
     at Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadHelper(Stream stream, PropertyCategories propertyCategories, IFormatter formatter)\r\n
     at Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadFromXml(Stream stream, PropertyCategories propertyCategories)\r\n
        at Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadFromXml(Stream stream)\r\n

I've looked at the two strings and see a very large number of differences so it's difficult for me to determine what the issue might be.

I have attached a file containing the text from the layout for v7.3.

Can anyone suggest what I should look at to determine the cause of this problem?

Thanks,

Gerry

Parents Reply Children