Unplanned
Last Updated: 20 Apr 2021 15:19 by ADMIN
Nicola
Created on: 17 Dec 2020 09:47
Category: GridView
Type: Bug Report
2
RadGridView: in hierachical grid SummaryRow value is not calculated correctly when grouping by child column
Good Afternoon,

I have a problem with radgridview :

grouping the column (GRP) of child template the summary row contains the correct data (12 RowCount for 62,40 summary), but if I try to sort a column and / or click on the summary row the datas is modified, the RowCount number becomes the total number of groups (4) and the amounts are reset (0,00).

Looking forward to your kind reply, I offer you my best regards.
3 comments
ADMIN
Nadya | Tech Support Engineer
Posted on: 20 Apr 2021 15:19

Hello, Nicola,

We always strive to address the issues that come from our clients. This issue is already addressed in our internal issue tracking system and should be planned soon. However, I can't give you an exact time frame when a fix will be introduced. Please click the Follow button in order to get notified once any status changes occur. 

Meanwhile, feel free to use the suggested here workaround. 

Should you have other questions please let me know.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Nicola
Posted on: 20 Apr 2021 11:16

Is it possible to know when this problem will be solved?

Thank You

ADMIN
Nadya | Tech Support Engineer
Posted on: 17 Dec 2020 10:01

Hello, Nicola,

To work around this issue, you can create a custom GridViewSummaryItem and override its Evaluate method. Thus, you can write your own logic for summary item evaluation:

' CUSTOM SUMMARY ITEMS
Public Class CustomSummaryItem
    Inherits GridViewSummaryItem
    Public Sub New(ByVal name As String, ByVal formatString As String, ByVal aggregate As GridAggregateFunction)
        MyBase.New(name, formatString, aggregate)
    End Sub
    Public Overrides Function Evaluate(ByVal row As IHierarchicalRow) As Object
        Dim total As Decimal = 0
        For Each childRow As GridViewRowInfo In row.ChildRows
            Dim groupRow As GridViewGroupRowInfo = TryCast(childRow, GridViewGroupRowInfo)
            Dim dataRow As GridViewDataRowInfo = TryCast(childRow, GridViewDataRowInfo)

            If groupRow IsNot Nothing Then
                For Each row1 As GridViewRowInfo In groupRow.ChildRows
                    total += (row1.Cells("TOT1").Value)
                Next row1
            ElseIf dataRow IsNot Nothing Then
                total += dataRow.Cells("TOT1").Value
            End If
        Next childRow
        Return total

    End Function
End Class

Public Class CustomSummaryCountItem
    Inherits GridViewSummaryItem
    Public Sub New(ByVal name As String, ByVal formatString As String, ByVal aggregate As GridAggregateFunction)
        MyBase.New(name, formatString, aggregate)
    End Sub
    Public Overrides Function Evaluate(ByVal row As IHierarchicalRow) As Object
        Dim total As Decimal = 0
        For Each childRow As GridViewRowInfo In row.ChildRows
            Dim groupRow As GridViewGroupRowInfo = TryCast(childRow, GridViewGroupRowInfo)
            Dim dataRow As GridViewDataRowInfo = TryCast(childRow, GridViewDataRowInfo)

            If groupRow IsNot Nothing Then
                For Each row1 As GridViewRowInfo In groupRow.ChildRows
                    total += 1
                Next row1
            ElseIf dataRow IsNot Nothing Then
                total += 1
            End If
        Next childRow
        Return total
    End Function
End Class

I hope this helps.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.