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.

Save/Open Grid Data

Thread ID:

Created:

Updated:

Platform:

Replies:

22573 Dec 15,2004 01:06 PM Dec 15,2004 05:20 PM Windows Forms 1
loading
Tags: GridControl
Avrum Tilman
Asked On December 15, 2004 01:06 PM

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 05:20 PM

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.

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.

;