Hiding a nested grid

I''m trying to hide a nested grid with no actual rows in the way it was posted in other posts in the forum, but I just get an empty space where nothing is shown (like in the screen capture I''m sending). This is the code I''m using: private void grid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if (e.TableCellIdentity.TableCellType == GridTableCellType.NestedTableCell) { Element cell = e.TableCellIdentity.DisplayElement; Record r = cell.ParentRecord as Record; if (r != null && r.NestedTables.Count > 0 && r.NestedTables[0].ChildTable.GetFilteredRecordCount() == 0) { e.Style.CellType = "Static"; e.Handled = true; } } } Thanks in advance

grid2.zip

4 Replies

AD Administrator Syncfusion Team December 4, 2005 12:30 AM UTC

Try this code.
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.GetFilteredRecordCount() == 0)
	{
		e.Style.CellType = "Static";
		e.Style.Borders.Bottom = new GridBorder(this.gridGroupingControl1.TableModel.Options.DefaultGridBorderStyle, SystemColors.GrayText);
	}
}
Here is a sample. http://www.syncfusion.com/Support/user/uploads/GGC_PasteSort_27ab40b7.zip


AS Alejandro Serrano December 4, 2005 10:36 AM UTC

However, I need that the header and column headers don''t appear. Alltable must be hidden (like in the picture I sent, but without any space or line).


AS Alejandro Serrano December 4, 2005 11:17 AM UTC

OK, I finally got the response. I had a pair of properties that made it impossible to hide them.


AD Administrator Syncfusion Team December 5, 2005 12:34 AM UTC

You can set the row height to be zero, but this takes a custon grouping engine. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GGC_PasteSort_48414835.zip

Loader.
Up arrow icon