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
278
DisplayLayout SaveAsXml and LoadFromXml
posted

 Hi,

I can save and load WinGridLayout , but Layout  don't load. (use Infragistics .NET 2007 v7.3 fix 1043)

that I did not do so?

      MemoryStream stream = new MemoryStream();
      gridDocuments.DisplayLayout.SaveAsXml(stream, PropertyCategories.All);
      string strSettingsGrid = System.Text.Encoding.UTF8.GetString(stream.ToArray());
      stream.Close();

//next save Layout in DB

//Load from DB and bindLayout

        byte[ bt = System.Text.Encoding.UTF8.GetBytes(layout.xmlGridSettings);
        MemoryStream stream = new MemoryStream(bt, 0, bt.Length);
        gridDocuments.DisplayLayout.LoadFromXml(stream, PropertyCategories.All);


   Thanks.

 

Parents
  • 469350
    Offline posted

    Without more information, it's hard to guess. Are you changing the grid's data source in between the save and load? The layout you load has to match the data structure of the grid's data source. If it does not match exactly, it won't work.   

    Also, I'm not sure storing the bytes in a string like this will work. Why do you need a string? Why not just use the stream?  

Reply Children