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
920
UltraGridLayout.Clone() in version 9.1
posted

Hallo,

 

I want so save the Layout of my UltraGrid for later using.

Thats why i convert it to a String and save it to Database.

 

I use the follering code:

// this.Infos.Grid is my Grid

MemoryStream firstStream = new MemoryStream();

this.Infos.Grid.DisplayLayout.SaveAsXml(firstStream);
Encoding encoding = System.Text.Encoding.Default;
string result = encoding.GetString(firstStream.ToArray());

 

----

Than the problem apperacs that some Grid's have many ValueList's

thats why the lengt of result becomes over 1700000. This was unperformat.

Whith version 8.3 we used the following code:

MemoryStream firstStream = new MemoryStream();

UltraGridLayout tmpLayout = Infos.Grid.DisplayLayout.Clone();
tmpLayout.ValueLists.Clear();
tmpLayout.SaveAsXml(firstStream);

Encoding encoding = System.Text.Encoding.Default;
string result = encoding.GetString(firstStream.ToArray());

----

this cuts the lengt form 1700000 to about 66000 and work much more performant.

 

Now we installed version 9.1 (and cleared all old Layouts from Database)

the loading of the short Layout does not work. For instance the Column Header.Caption is lost also the group by information.

The loading of the long layoutinformations works as expected.

 

Any idea whats wrong or what i can do? Cut it be that Clone() not works right in the new Version?

 

Best regards

  Wolfgang

  • 469350
    Verified Answer
    Offline posted

    Hi Wolfgang,

    I am not aware of any problems in this area, but if this worked in the previous version and does not work now, it's almost certainly a bug. We try very hard not to break backward compatilibity.

    There's no way I can guess what's wrong here, though. So I recommend that you create a small sample project which demonstrates the issue and Submit an incident to Infragistics Developer Support.

    On a side note, you probably don't need to clear the ValueLists collection. The SaveAsXml method has an optional parameter that allows you to choose what you want to save and you can exclude the ValueLists by simply passing in a value that does not include the ValueLists flag.