Skip to content

SyncfusionExamples/how-to-get-the-summary-row-value-from-windows-forms-data-grid

Repository files navigation

How to Get the Summary Row Value from WinForms DataGrid?

This example illustrates how to get the summary row value from WinForms DataGrid (SfDataGrid).

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);

Getting the summary row value using GetSummaryDisplayTextForRow method

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);

Getting the summary row value using GetSummaryDisplayText method

About

How to get the summary row value from windows forms data grid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages