Thanks for your help, Haneef. If we use this approach, there's a white space for each "Static" cell. I think it's better if the first column (the tiny column on the left that has the black arrow) is hidden. Could I make it hidden?
Regards,
Cuong Luc.
>Hi Cuong,
You could try this in the QueryCellStyleInfo event handler. Here is some code that hides the +/- pushbutton for the records that doesn't have child records, you can handle the QueryCellStyleInfo checking for the nestedtable's record count and set the +/- pushbutton celltype to Static/Header.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if(e.Style.CellType == "PushButton")
{
if(e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
Record rec = (Record) e.TableCellIdentity.DisplayElement.ParentRecord;
if(rec.NestedTables[0].FilteredRecords.Count == 0)
{
e.Style.CellType = "Static";
e.Style.Enabled = false;
}
}
}
}
Please refer to the attached sample for implementation.
Here is a sampleBest regards,
Haneef