SummaryColumn: problems with QueryHowHeight event?

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


5 Replies

MA Mohanram Anbukkarasu Syncfusion Team October 11, 2021 12:46 PM UTC

Hi David, 

Thanks for contacting Syncfusion products.  

We regret to let you know that we are unclear about the problem you are facing in the Grid “B” due to the QueryRowHeight event customization. Kindly revert to us with more details about the issue with image/video illustration and more code snippets. It will be more helpful for us to find the exact cause for the issue and to provide a prompt solution.  

Regards, 
Mohanram A. 



DA DavidBS October 11, 2021 03:41 PM UTC

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"

gridA.jpg


See results on grid "B":

gridB.jpg



MA Mohanram Anbukkarasu Syncfusion Team October 12, 2021 11:35 AM UTC

Hi David, 

Thanks for the update.  

We have prepared a sample with two SfDataGrid with TableSummary and same DataSource and also handled QueryRowHeight event for one of them to replicate your scenario. But unfortunately we are unable to reproduce the reported issue in our end. The sample we have used to check this issue is available in the following link for your reference.  


Please have a look at this sample and let us know if we have missed any other customization you have done in your application along with the code snippets. Otherwise try to reproduce the reported issue in this sample and revert to us with the modified sample. It will be more helpful for us to find the exact cause for the issue and to provide a prompt solution.  

Regards, 
Mohanram A. 



DA DavidBS October 12, 2021 12:38 PM UTC

Hi Mohanram,


Thank you.
I'll check your sample and see what is going on here.

I'll be back soon.

Kind regards,

David




MA Mohanram Anbukkarasu Syncfusion Team October 13, 2021 05:47 AM UTC

Hi David, 

Thanks for the update.  

We will wait to hear from you.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon