Articles in this section
Category / Section

How to get the summary row value from Windows Forms DataGrid(SfDataGrid)?

1 min read

SfDataGrid allows you, to retrieve the value of summary rows by using the SummaryCreator. GetSummaryDisplayTextForRow method when GridSummaryRow.ShowSummaryInRow is true.

var summary = this.sfDataGrid.View.Records.TableSummaries[0];
var value = SummaryCreator.GetSummaryDisplayTextForRow(summary, this.sfDataGrid.View);
MessageBox.Show(value);

Get the SummaryRow value.

And you can also retrieve the value of each summary column by using the SummaryCreator.GetSummaryDisplayText method when GridSummaryRow.ShowSummaryInRow is false.

var summary = this.sfDataGrid.View.Records.TableSummaries[0];
//Retrieves the summary row value of the Quantity column. 
var value = SummaryCreator.GetSummaryDisplayText(summary, "Quantity", this.sfDataGrid.View);
MessageBox.Show(value);

Get the SummaryColumn value.

  View sample in GitHub

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please  to leave a comment
Access denied
Access denied