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

Collapse all records

Thread ID:

Created:

Updated:

Platform:

Replies:

92844 Feb 8,2010 04:06 PM UTC Feb 9,2010 10:51 AM UTC WinForms 6
loading
Tags: GridControl
Plotnikova
Asked On February 8, 2010 04:06 PM UTC

Hello,

We use GridGroupingControl.
In toolstrip we have a possibility to expand and collapse all records. [grid.Table.ExpandAllRecords(); and grid.Table.CollapseAllRecords();]

If the user clicked on the Collapse All and tries to expand one node, no records will be shown in child table just header.

How can I fix this problem?

Thanks
Best Regards

Jisha Joy [Syncfusion]
Replied On February 9, 2010 06:07 AM UTC

Hi Plotnikova,

The collapseall code is collapsing the groups, and if you want them expanded again as you click the parent record's expand button, then you will have to explicitly expand them at that point. This was done by adding a RecordExpanded event handler and doing it there.

See the code:

bool ignoreExpand;
void gridGroupingControl1_RecordExpanded(object sender, RecordEventArgs e)
{
if (ignoreExpand)
return;
ignoreExpand = true;
if (e.Record.NestedTables.Count > 0)
{
GridNestedTable nt = e.Record.NestedTables[0] as GridNestedTable;
nt.IsExpanded = true;
}
ignoreExpand = false;

}

Please let me know if this helps.

Regards,
Jisha

Plotnikova
Replied On February 9, 2010 08:17 AM UTC

Hi Jisha,

thank you so much. It helps.

What can I do if by expanding all records I don't want to show the nested records, if the count of nested records is 0.

Best Regards
Svetlana

Jisha Joy [Syncfusion]
Replied On February 9, 2010 08:39 AM UTC

Hi,

Please see the following KB article that shows how to hide the childtable that doesnot have any records to show up in GridGroupingControl.

http://www.syncfusion.com/support/kb/721/How-to-hide-the-ChildTable-that-doesn

Sample can be accessed from the following link:

http://help.syncfusion.com/samples/kb/grid.windows/GGCHideEmptyChildTable/main.htm


Regards,
Jisha

Plotnikova
Replied On February 9, 2010 08:48 AM UTC

Hi,

the problem is, when I override a Factory, all others grid in project where sorce has 0 items will not be displayed.

Plotnikova
Replied On February 9, 2010 10:06 AM UTC

I have added the extra condition [this.Engine.TableDescriptor.Relations.Count>0 ] in this new Factory for functions of overriden class GridChildTable.
So it means if the other grid, that does not have children, will be displayed.

I hope that this solution will work reliable.

Best Regards
Svetlana

Jisha Joy [Syncfusion]
Replied On February 9, 2010 10:51 AM UTC

Hi Svetlana,

Thank You for your update.

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

;