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.

Child records are not expanded on DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

67216 Aug 10,2007 04:19 AM Aug 10,2007 07:28 AM Windows Forms 1
loading
Tags: GridControl
Rahul Srivastava
Asked On August 10, 2007 04:19 AM

Hi,

I am using Syncfusion DataBoundGrid.
I am assigning DataSet as datasource, the grouping works for the first time, and I am able to expand parent to see the child records.

But my requirment is that i get new DataSet ( of the same schema as above) every 1 second. And I need to bind that data again to the DataBoundGrid. This time I can see grouping of records, but I can not see the child records when I click on the + sign.

I am using same function to bind data on the dataGrid. here is the function.

private void UpdateGrid(DataSet ds)
{
lock(dsParentChild)
{
dsParentChild = ds;
grdData.DataMember = "ParentTable";
grdData.DataSource = dsParentChild;
grdData.Binder.AddRelation("ParentID");
}
}

My dataset contains Parent Child Relation, and the RelationName is "ParentID", which I am adding to the Binder.

Please let me know where I am going wrong.

Thanks and Regards,
Rahul Srivastava

Jeba S [Syncfusion]
Replied On August 10, 2007 07:28 AM

Hi Rahul,

Thank you for posting query to us.

In GridDataBoundGrid the child lists are not known until the parent node is expanded, and the GridDataBoundGrid does not try to subscribe to these transient child list events to be able to respond to list updating. In the below sample, the childlist.ListChanged event is subscribed to in RowExpanded and unsubscribed to in RowCollapsing. In the event handler, grid.InvokeRequired is used to make sure the subsequent code is being done on the UI thread. This code essentially collapses the parent node and then expands it. It suspends the drawing to avoid the flicker you would normally see if you tried this. It uses a FreezePainting property in a derived GriddataBoundGrid to suspend the drawing because the normal grid.BeginUpdate/EndUpdate does not work in this situation. It also has to slightly delay the expanding of the node to allow the ListChanged event to complete itself before the node is actually re-expanded.

Please refer this sample and let us know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/F67216/main.htm

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

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.

;