Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# How to get the summary row value from Windows Forms DataGrid(SfDataGrid)
## About the sample
This example illustrates how to get the summary row value from Windows Forms DataGrid(SfDataGrid)
# How to Get the Summary Row Value from WinForms DataGrid?

SfDataGrid allows you, to retrieve the value of summary rows by using the SummaryCreator.GetSummaryDisplayTextForRow() method when GridSummaryRow.ShowSummaryInRow is true.
```c#
This example illustrates how to get the summary row value from [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid).

SfDataGrid allows you, to retrieve the value of summary rows by using the `SummaryCreator.GetSummaryDisplayTextForRow` method when [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.GridSummaryRow.html#Syncfusion_WinForms_DataGrid_GridSummaryRow_ShowSummaryInRow) is true.

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

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

![Getting the summary row value using GetSummaryDisplayTextForRow method](ValueFromGetSummaryDisplayTextForRow.png)

And you can also retrieve the value of each summary column by using the SummaryCreator.GetSummaryDisplayText method when [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.GridSummaryRow.html#Syncfusion_WinForms_DataGrid_GridSummaryRow_ShowSummaryInRow) is false.

```c#
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);
```

## Requirements to run the demo
Visual Studio 2015 and above versions
![Getting the summary row value using GetSummaryDisplayText method](ValueFromGetSummaryDisplayText.png)
Binary file added ValueFromGetSummaryDisplayText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ValueFromGetSummaryDisplayTextForRow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.