Hi Eric Nguyen,
Based on the information provided, we understand that you would like to retrieve the final calculated text, such as "5 10 15 20", from the SummaryRow of the SfDataGrid and update the grouped row caption text format with these values. This can be accomplished by retrieving the table summary row text using the GetSummaryDisplayText method and updating the caption summary row text using the SfDataGrid.GroupCaptionTextFormat property.
To assist you further, we have prepared a sample that demonstrates this approach. Please refer to the following code snippet:
C# code snippet:
private void DataGrid_Loaded(object sender, RoutedEventArgs e) { var summary = this.dataGrid.View.Records.TableSummaries[0]; var summaryValues = new List<string>(); foreach (var column in dataGrid.Columns) { var value = SummaryCreator.GetSummaryDisplayText(summary, column.MappingName, this.dataGrid.View); // Only add if the summary value is not null or empty if (!string.IsNullOrWhiteSpace(value)) { summaryValues.Add(value); } } string customText = string.Join(" ", summaryValues); dataGrid.GroupCaptionTextFormat = "Totals: " + customText; } |
Find the sample demo in the attachment.
Please let us know if this solution meets your requirements.
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.
Regards,
Malini Selvarasu
Attachment:
SfDataGrid_Demo_386b04c0.zip