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.
Syncfusion Feedback

Hiding a nested grid once again

Thread ID:

Created:

Updated:

Platform:

Replies:

38251 Dec 8,2005 08:20 PM UTC Jul 23,2012 10:52 AM UTC WinForms 8
loading
Tags: GridControl
Alejandro Serrano
Asked On December 8, 2005 08:20 PM UTC

Once again, I''m trying to hide a table. The problem now is that I have two related tables, one of it has records and the other one don''t. So the second one is shown empty. I would like to be able to hide the empty tables, plus the functionality I have now of not showing the +/- button when all tables are empty. Here''s the code I''m using, in a GGC: if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordPlusMinusCell) { Element cell = e.TableCellIdentity.DisplayElement; Record r = cell.ParentRecord as Record; bool makeStatic = true; if (r != null && r.NestedTables.Count > 0) { foreach (NestedTable nt in r.NestedTables) { if (nt.ChildTable.GetFilteredRecordCount() != 0) makeStatic = false; } } if (makeStatic) { e.Style.CellType = "Static"; e.Style.Borders.Bottom = new GridBorder(grid.TableModel.Options.DefaultGridBorderStyle, SystemColors.GrayText); } }

Administrator [Syncfusion]
Replied On December 8, 2005 08:49 PM UTC

At the bottom of this thread, there is a sample that shows how to set the rowheight to zero to hide a child table. Maybe that will work for you in this case. http://www.syncfusion.com/Support/forums/message.aspx?MessageID=37998

Alejandro Serrano
Replied On December 9, 2005 10:16 AM UTC

I just want to hide the related table, not the entire row, because a row can have an empty table and a non-empty table, so just one must be shown.

Administrator [Syncfusion]
Replied On December 9, 2005 11:24 AM UTC

Hi Serras, Try this and let me know if this serves your purpose. private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordPlusMinusCell) { Record r = e.TableCellIdentity.DisplayElement.ParentRecord as Record; if (r != null && r.NestedTables.Count > 0 && r.NestedTables[0].ChildTable.Records.Count == 0) { e.Style.Enabled = false; e.Style.Clickable = false; } } } Best regards, Stanley

Alejandro Serrano
Replied On December 10, 2005 08:01 PM UTC

That is not the type of hiding I need. I''ve posted a small picture of my grid to explain a bit better what I want to achieve.

post.zip

Administrator [Syncfusion]
Replied On December 11, 2005 10:32 AM UTC

Here is a sample. http://www.syncfusion.com/Support/user/uploads/GGC_PasteSort_af331e6d.zip The first parent record in the has two empty child tables, so no +/- is shown. The second parent record has one populated child table and one empty child table. The empty child table is hidden by setting rowheights = 0 for its caption row, column header row and addnew row.

Ramesh Suhar
Replied On July 21, 2012 05:05 AM UTC

Hello Sir

I there any way to hide the nested empty table from gridgrouping control


Ramesh Suhar
Replied On July 21, 2012 05:05 AM UTC

Hello Sir

I there any way to hide the nested empty table from gridgrouping control


Ragamathulla B [Syncfusion]
Replied On July 23, 2012 10:52 AM UTC

Hi Ramesh,
 
Please refer to the following sample which acheive your desired behaviour.
 
 
Let me know if you have any further concerns.
 
Regards,
Ragamathullah B.

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

;