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.
Syncfusion Feedback

column header sequence

Thread ID:

Created:

Updated:

Platform:

Replies:

117644 Nov 21,2014 07:31 PM UTC Nov 25,2014 02:05 PM UTC WPF 1
loading
Tags: GridDataControl
Shwe
Asked On November 21, 2014 07:31 PM UTC

Hi,
     May I know how to save syncfusion grid data control column headers as a string into database after drag and drop the columns. And then, I logout my application. After login, I would like to retrieve the columns header strings that is saved from database and show the sequence of the columns headers in grid.


Thanks

Ashok N [Syncfusion]
Replied On November 25, 2014 02:05 PM UTC

Hi Shwe,

Thank you for contacting Syncfusion support.

We have analyzed your query and you can achieve your requirement by using Serialization and Deserialization support. You can save the changes by using dataGrid.Model.Serialize method and you can reload that changes by using dataGrid.Model.Deserialize method. Please refer the below code snippet to achieve your requirement.

In this code snippet we have serialize the grid using Button click event. You can use this Serialize method to your application, where you want to serialize the grid and  for reloading, you can handle datagrid.Loaded event, within this event you can call Deserialize method.

C# code snippet:

private void serialization_Click(object sender, RoutedEventArgs e)

{

    this.dataGrid.Model.Serialize("Files.xml");

    this.mainwindow.Close();

}

void dataGrid_Loaded(object sender, RoutedEventArgs e)

{

    if (File.Exists("Files.xml"))

        this.dataGrid.Model.Deserialize("Files.xml");

}

 

Please let us know if you require further assistance.

Thanks,

Ashok


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.

Warning Icon 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.Close Icon

;