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.
Unfortunately, activation email could not send to your email. Please try again.

Reset columns order & widths

Thread ID:

Created:

Updated:

Platform:

Replies:

103024 Mar 23,2012 09:02 AM Mar 30,2012 08:02 AM WPF 3
loading
Tags: GridControl
Juraj Tomana
Asked On March 23, 2012 09:02 AM

Hi,

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

Thanks.


Rajasekar [Syncfusion]
Replied On March 27, 2012 07:26 AM

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



Juraj Tomana
Replied On March 28, 2012 02:19 AM

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.


Rajasekar [Syncfusion]
Replied On March 30, 2012 08:02 AM

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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;