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. Image for the cookie policy date

GridGroupingControl (Refreshing)

Hi!
I have a GGC linked a table, however I need refreshes the data which was modified.
What is necessary to refresh a GGC? It´s not only do:

gridgroupingcontrol1.datasource = null;
gridgroupingcontrol1.datasource = mytable;

Thanks!

Ediberto

6 Replies

AD Administrator Syncfusion Team June 26, 2009 02:54 PM UTC

Solved!


SU Santosh U July 17, 2009 03:04 PM UTC

Hi,

Can you please give the solution to me ??

Thanks


RC Rajadurai C Syncfusion Team July 21, 2009 06:15 AM UTC

Hi Santosh,

Thanks for your interest in Syncfusion Products.

Please try setting TableDirtyOnSourceListReset property to true as this forces the engine to set TableDirty property to true thereby making grid refresh the data when the underlying datasource raises notification because of change.

this.gridGroupingControl1.TableDirtyOnSourceListReset = true;


If you are handling any change to record cells manually through code. You can add that code snippet between BeginUpdate() and EndUpdate() method.

Regards,
Rajadurai


SU Santosh U August 4, 2009 01:41 PM UTC

Hi,

I have used the code but it does not work.

I will little brief about my requirement.

I have two tables for example products and its details.

I have a form above the grid having all details for Product and details as well. Once I Save that in to database and reset my dataset and bind it again and say gcc.update() it just shows the product and not the details.

Following is my code ( I am using Related Master details for hierarchy ).

private void BindGrid()
{
dtprod = getallproducts().Tables[0];
dtproddetails = getallproductdetails().Tables[0];
GridTableDescriptor RootTbl = gridGroupingControl1.TableDescriptor;

gridGroupingControl1.Engine.SourceListSet.Add("Product", dtprod);
gridGroupingControl1.Engine.SourceListSet.Add("ProductDetails", dtproddetails);

GridRelationDescriptor TestCaseToSteps = new GridRelationDescriptor();
TestCaseToSteps.ChildTableName = "ProductDetails";
TestCaseToSteps.RelationKind = Syncfusion.Grouping.RelationKind.RelatedMasterDetails;
TestCaseToSteps.RelationKeys.Add("product_id", "product_id");

gridGroupingControl1.TableDescriptor.Relations.Add(TestCaseToSteps);
gridGroupingControl1.DataSource = dtprod;
}

after saving new product and its details i update the grid in following manner
UpdateGrid()
{
dtprod = getallproducts().Tables[0];
dtproddetails = getallproductdetails().Tables[0];
gridGroupingControl1.DataSource = dtprod;
gridGroupingControl1.Update();
}


But the above code does not work properly it just shows the Product in the grid after update and the underlying grid (the details one) does not get updated).

Please help me.
Thanks,
Santosh U


RC Rajadurai C Syncfusion Team August 5, 2009 02:47 PM UTC

Hi Santosh,

Thanks for your details.

While rebinding the related datatables, ensure the following has been done.
1) Add the relation to the tabledescriptor.
2) Add the child table to the SourceListSet collection of Engine.(If this is not set after setting the datasource to null and before rebinding the datasource, the childtable items cannot get displayed).

Here is the code that has to be handled while rebinding inorder to show the grid without losing its relation.

this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.TableDescriptor.Relations.Add(parentToChildRelationDescriptor);
this.gridGroupingControl1.Engine.SourceListSet.Add("ProductTable", productTable);
this.gridGroupingControl1.Engine.SourceListSet.Add("DetailTable", detailTable);
this.gridGroupingControl1.BeginUpdate();
this.gridGroupingControl1.DataSource = productTable;
this.gridGroupingControl1.EndUpdate(true);

Please refer to the following sample in which this code has been implemented.
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/F83649a.zip

Regards,
Rajadurai


SU Santosh U August 12, 2009 01:34 PM UTC

Hi Rajadurai,

This works gr8 now.

Thanks for the help.

Santosh U

Loader.
Live Chat Icon For mobile
Up arrow icon