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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save/Open Grid Data

Thread ID:

Created:

Updated:

Platform:

Replies:

22573 Dec 15,2004 06:06 PM UTC Dec 15,2004 10:20 PM UTC WinForms 1
loading
Tags: GridControl
Avrum Tilman
Asked On December 15, 2004 06:06 PM UTC

I am using the GridControl. Is there an easy way to save all the data in the grid to a file and then repopulate the grid with the data in the file later? Thanks

Administrator [Syncfusion]
Replied On December 15, 2004 10:20 PM UTC

You can use LoadBinary and SaveBinary which are members of the GridModel class. LoadBinary is static, so you use it through the class name. Here are some code snippets.
[cs]
private void button2_Click(object sender, System.EventArgs e)
{
	//save to file
	this.gridControl1.Model.SaveBinary(@"c:\mygrid.grd");
}

private void button1_Click(object sender, System.EventArgs e)
{
	//load from file
	this.gridControl1.Model = GridModel.LoadBinary(@"c:\mygrid.grd");
}

[vb.net]
Private Sub button2_Click(sender As Object, e As System.EventArgs)
   ’save to file
   Me.gridControl1.Model.SaveBinary("C:\mygrid.grd")
End Sub ’button2_Click

Private Sub button1_Click(sender As Object, e As System.EventArgs)
   ’load from file
   Me.gridControl1.Model = GridModel.LoadBinary("C:\mygrid.grd")
End Sub ’button1_Click ’

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

;