Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148519 | Oct 23,2019 12:24 PM UTC | Oct 25,2019 05:08 AM UTC | WinForms | 4 |
![]() |
Tags: SfDataGrid |
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;
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.