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

Assign Database in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

107396 Feb 27,2013 02:00 PM UTC Feb 28,2013 11:50 AM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 27, 2013 02:00 PM UTC

Hello,
 
Can you please explain us.. how to assign datatable / dataset into GridControl..?
 
And which grid is more suitable for Data Entry...?
 
Thanks

Vinish Kumar K [Syncfusion]
Replied On February 28, 2013 11:50 AM UTC

Hi Rajnikant,

 

Thank you for your interest in Syncfusion products.

 

Query

Assign Database in GridControl

To access the dataset in Grid, Initially load the dataset to the grid using the following code snippet.

 

//load the dataset

 

this.sqlDataAdapter1.Fill(this.dataSet11);

 

After loading you can retrieve records from the Grid itself. If you are using the VS designer to add your daatset and datatable, if you allow it to generate Update commands, then you only have to call this.sqlDataAdapter1.Update to have the dataadapter move the changes back to the data source. This is analogous to the this.sqlDataAdapter1.Fill command that retrieves the information when the data is originally loaded.

 

If you trying to rebind a datasource, you have to reset the DataSource before rebinding it. You can follow the below code snippets for rebinding a DataSource in GridGroupingControl.

 

Below is the code snippet:

 

 

this.gridGroupingControl1.DataSource = null;

this.gridGroupingControl1.DataMember = null;

this.gridGroupingControl1.ResetTableDescriptor();

this.gridGroupingControl1.TableDescriptor.Relations.Clear();

this.gridGroupingControl1.DataSource = ds.Tables[1];

this.gridGroupingControl1.Reinitialize();

this.gridGroupingControl1.Refresh();

 

please use the above suggestion and let me know if this helps to you. And please provide the any sample and some more details if you need any more information about this. This will helps us to provide quick response,

 

 

 

Warm Regards,

Vinish Kumar K


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

;