Hi ,
I am using the Grid.DisplayLayout.SaveAsXml method for saving the layout and Grid.DisplayLayout.LoadAsXml for loading the grid layout from the files.
However when ever I load the layout , i dont get the exact setting I have stored in the file.
For ex , all hidden column appear , spacing settings are gone(AutoColumnSizze n all) , If we rename a column name for viewing ...it also gets restored as the original one.(ex. if I set SecurityID as SecID in the Designer , it gets wiped off after loading from the file.)
I am using the following lines of code , Can some body please tell me If i am missing something.
System.IO.
.OpenOrCreate);
)
{
FileLayout.Seek(0, System.IO.
.Begin);
.All);
And for loading :
SeekOrigin.Begin);
if (FileLayout.Length > 0)
this.DisplayLayout.Load(FileLayout);
}
Thanks ,Ashish.
Hi Ashish,
I don't immediately see anything wrong with this code. My guess is that there's probably some kind of timing problem going on here. Like maybe you are loading the layout and then setting the DataSource on the grid which clears the layout. You need to set the DataSource first in such a case.
Hi Mike ,
Thanks for the suggestion , that worked with a minor issue.
I am saving the layout after the data binding is complete . But when I load it the layout persists but the column positions are shaky which gets in positions after yje click on them ..........
Am i missing something here??/
Thanks,Ashish
Ashish_293850 said: the column positions are shaky which gets in positions after yje click on them
I'm afraid I do not understand what this means.
there were minor issues , but it worked ....Thanks a ton for your help.
Regards,Ashish.