this.sfDataGrid1.Columns.Add(new GridUnboundColumn() { MappingName ="DisplayCount", HeaderText = "Display Count" });
this.sfDataGrid1.QueryUnboundColumnInfo += SfDataGrid1_QueryUnboundColumnInfo;
private void SfDataGrid1_QueryUnboundColumnInfo(object sender, Syncfusion.WinForms.DataGrid.Events.QueryUnboundColumnInfoArgs e)
{
var index = this.sfDataGrid1.TableControl.ResolveToRowIndex(e.Record);
if (e.UnboundAction == UnboundActions.QueryData)
{
var detailsViewDataGrid = SelectionHelper.GetDetailsViewGrid(this.sfDataGrid1, index + 1);
if (detailsViewDataGrid != null)
{
var count = detailsViewDataGrid.RowCount;
if (count != 1)
e.Value = count.ToString();
else
e.Value = 0;
}
else
e.Value = 0;
}
} |