Hiding a nested grid once again

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); } }

8 Replies

AD Administrator Syncfusion Team 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


AS Alejandro Serrano 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.


AD Administrator Syncfusion Team 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


AS Alejandro Serrano 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


AD Administrator Syncfusion Team 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.


RS Ramesh Suhar July 21, 2012 05:05 AM UTC

Hello Sir

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



RS Ramesh Suhar July 21, 2012 05:05 AM UTC

Hello Sir

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



RB Ragamathulla B Syncfusion Team 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.

Loader.
Up arrow icon