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. Image for the cookie policy date

Child record count zero

Is there a way to set my Grid Grouping Control, so that if a parent row has zero child records, it will not show the +-?


1 Reply

RS Rajarajeswari S Syncfusion Team January 22, 2008 03:58 AM UTC



Hi Kathy,

Thanks for using Syncfusion products.

When the Child table's record count is zero the Plus/Minus cell type of its Parent table should be set as static to make it disappear. Please refer the below code snippet which illustrates this:

[C#]
protected 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.FilteredChildNodeCount == 0)
{
e.Style.CellType = "Static";
}
}
}

Please refer the below KB link to get more details and sample which illustrates the above:

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=311

Please let me know if this helps you out.

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon