We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reset columns order & widths

Hi,

Is it possible to reset columns (GridDataControl.GridVisibleColumn) order and width?

Thanks.


3 Replies

RA Rajasekar Syncfusion Team March 27, 2012 11:26 AM UTC

Hi Tomana,

Thanks for your reply.

You can achieve this requirement by Serializing and De- Serializing the GridModel by using the below two methods based on your desired condition,

grid.Model.Deserialize(@"..\..\test.xml");

grid.Model.Serialize(@"..\..\test.xml");

Please let us know if you have any queries.

Thanks,
Rajasekar




JT Juraj Tomana March 28, 2012 06:19 AM UTC

Hi. Thank You for Your reply, but I didn't thougth de-/serialization of grid-settings.

I design my grid in XAML, after that I start application and play with grid (resize columns, move columns, ... ). Is there possibility from the code to reset grid to the default (start-up) look?

Thanks.



RA Rajasekar Syncfusion Team March 30, 2012 12:02 PM UTC

Hi Tomana,

Thanks for your reply.

1)In the GridDataControl loaded event you can Serialize the GridDataTableModel by using the below methods,

grid.Model.Serialize(@"..\..\test.xml");

2)Now you can play with grid like resizing columns, editing the values..etc.

3)Then, you can De-Serialize by using the below method by using some button click event.

grid.Model.Deserialize(@"..\..\test.xml");

4)Now you can get the original startup look.

Please let us know if you have any queries.

Thanks,
Rajasekar



Loader.
Live Chat Icon For mobile
Up arrow icon