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,
|