Hi All!
I have two similar SfDataGrid in my application (one is a copy of the other, that's important), and let's name them as "A" and "B".
Grid "A" shows the TableSummaryRow/GridSummaryColumn normally whenever a new row is added into; but the grid "B" doesn't!
The only difference between them is that "B" has:
- a custom-defined QueryRowHeight event, to allow the grid to show a field with many strings separated by "environment.newline" (Cr-Lf)
- an AutoFitOptions to comply the above event with some "ExcludeColumns". But, the column utilized to "summarize" is not defined as an excluded column.
So, it seems the problem may reside in a conflict between Summary and the QueryRowHeight event,
Is there anyone knowing something about this and how solve this problem?
The code is below:
Private autoFitOptions As New RowAutoFitOptions()
Private autoHeight As Integer
Private excludeColumns As New List(Of String) From {"Tam", "Elapsed", "Status"}
Dim tableSummaryRow1 As New GridTableSummaryRow()
tableSummaryRow1.Name = "TableSummary"
tableSummaryRow1.ShowSummaryInRow = True
tableSummaryRow1.Title = "{Contagem}"
tableSummaryRow1.Position = Enums.VerticalPosition.Bottom
Dim summaryColumn1 As New GridSummaryColumn()
summaryColumn1.Name = "Contagem"
summaryColumn1.SummaryType = Syncfusion.Data.SummaryType.CountAggregate
summaryColumn1.Format = "{Count}"
summaryColumn1.MappingName = "FileName"
tableSummaryRow1.SummaryColumns.Add(summaryColumn1)
myGrid.TableSummaryRows.Add(tableSummaryRow1)
--------------
Private Sub MyGrid_QueryRowHeight(sender As Object, e As QueryRowHeightEventArgs) Handles MyGrid.QueryRowHeight
Try
If MyGrid.AutoSizeController.GetAutoRowHeight(e.RowIndex, autoFitOptions, autoHeight) Then
If autoHeight > 10 Then
e.Height = autoHeight
e.Handled = True
End If
End if
Catch ex As Exception
End Try
End Sub
Thanks in advance for any h
Hi Mohanram,
Basically, both grid have the same line with summary but the grid "B" does not update "Contagem" field, showing always "0".
And the grid "B" was copied from a form to another one (from "A") and both are seeing the same fields (and Mapping) and processing the same data files.
The only difference is based on the RowHeight which, due to some intrinsics of string displayed on one column (a lot of Environment.Newline within), I need to set the row height accordingly.
See results in grid "A"
See results on grid "B":
Hi Mohanram,
Thank you.
I'll check your sample and see what is going on here.
I'll be back soon.
Kind regards,
David