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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Child tables of new rows that should be hidden are unexpectedly displaying after saving to database

Thread ID:





46858 Jul 21,2006 07:59 PM UTC Jul 25,2006 12:42 PM UTC WinForms 5
Tags: Grouping
Scott Mercer
Asked On July 21, 2006 07:59 PM UTC


I have a GroupingGridControl that has conditionally displayed child tables implemented using a custom GridGroupingEngine that implements IGridRowHeight. The display of the child tables are determined based on a dropdown selection made in the parent row.

Unexpected behavior occurs when I create a new row at the parent level (that is supposed to have hidden child tables) and save to the database. After I save the DataSet, all child tables of the parent display regardless if their height setting. This only occurs if the parent row is expanded when saving. If I collapse and reexpand the parent node, the child tables are then painted as expected.

Using the example project I have attached, use the following steps to reproduce this error:

1) Start the application and add a new Widget row and give it a "Widget Type" or "Toy Widget".

2) Expand the "Toy Widget" row that you just added. The "Toy Widget" should only show the "WidgetPartsList" table below. Only "Industrial Widget" should show the "WidgetMaintenanceLog" table.

3) Click on the "Save" button. This should cause the "WidgetMaintenanceLog" table to unexpectedly appear under the new Widget.

4) Collapse then re-expand the newly added Widget row. Now only the WidgetPartsList should show up under the new Widget row.

Please let me know if any clarification is needed beyond the comments within the project.



Scott Mercer
Replied On July 21, 2006 08:04 PM UTC

I just wanted to clarify a couple of things:

In the instructions, item number (1) should read as follows:

1) Start the application and add a new Widget row and give it a "Widget Type" of "Toy Widget".

Also, I have experienced this behavior in versions and of Essential Studio.


Administrator [Syncfusion]
Replied On July 24, 2006 05:56 AM UTC

Hi Scott,

You can use this code snippet to re-expand the changed record of the GroupingGridControl. Please find the code snippet below.

////Attach the DisplayElement changing Event.
this.WidgetGroupingGrid.Table.DisplayElementChanging +=new DisplayElementChangingEventHandler(Table_DisplayElementChanging);

////insert the rows starting with the parents going down to the children breadth first
this.FakeInsertDataTable(this.WidgetData.Widget, "WidgetID");
this.FakeInsertDataTable(this.WidgetData.WidgetMaintenanceLog, "WidgetMaintenanceLogID");
this.FakeInsertDataTable(this.WidgetData.WidgetPartsList, "WidgetPartsListID");

////Deattach the DisplayElement changing Event.
this.WidgetGroupingGrid.Table.DisplayElementChanging -=new DisplayElementChangingEventHandler(Table_DisplayElementChanging);
if( rec.IsExpanded )
rec.IsExpanded = false;
rec.IsExpanded = true;

Record rec;
private void Table_DisplayElementChanging(object sender, DisplayElementChangingEventArgs e)
if( e.Element.ParentTableDescriptor.Name == "Widget")
rec = e.Element as Record;

Here is a sample.

Best Regards,

Scott Mercer
Replied On July 24, 2006 09:25 PM UTC


This solution does not work if you have more than one new record that is expanded. Your solution did point me in the right direction though. What you need to do is maintain an ArrayList (or Generic list in 2.0) of new Record objects that are currently expanded. After the inserts have occurred, then you have to go through every item in the ArrayList and flip its IsExpanded state to false, then back to true.

If have posted my fix if anyone is interested.

One question though. Although we have fixed the bahavior problem here, do you (Syncfusion the collective) think that the behavior I was observing is desired? Is that the way that the GridGroupingControl was designed to operate?



Scott Mercer
Replied On July 24, 2006 10:04 PM UTC

Oops! I posted the wrong file. The last message was exactly the same as Haneef''s example. This should be the correct one.



Administrator [Syncfusion]
Replied On July 25, 2006 12:42 PM UTC

Hi Scott,

Thanks for your update. I have contacted the development team regarding this issue and will be updating you soon.

Thanks for your patience.
Best Regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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