Aggregate functions in grouped grid

Posted by: milosic.bogdan on 17 November 2025, 6:13 am EST

  • Posted 17 November 2025, 6:13 am EST - Updated 17 November 2025, 6:18 am EST

    Hi all

    Is there any way to acomplish this - i get error:

    System.InvalidOperationException: ‘Dispatcher processing has been suspended, but messages are still being processed.’

    grdPORABASUR_s.ItemsSource = l.OrderBy(Function(p) p.DATUMCAS).ToList()
    
    Dim g_list As New List(Of DataGridColumn)
    
    g_list.Add(colMESTO)
    g_list.Add(colKODAS)
    
    grdPORABASUR_s.GroupBy(g_list.ToArray)
    
    Dim g_sort As New List(Of DataGridColumn)
    
    g_sort.Add(colMESTO)
    g_sort.Add(colDATUMCAS)
    g_sort.Add(colNR)
    
    grdPORABASUR_s.SortBy(g_sort.ToArray)
    
    AddHandler grdPORABASUR_s.Loaded, Sub(sender, e)
    
                                          Dispatcher.BeginInvoke(Sub()
                                                                     DataGridAggregate.SetAggregateFunctions(colDATUMCAS, New DataGridAggregatesCollection From {
                                                                       New DataGridAggregateCount With {.ResultFormat = "Število: {0}"}
                                                                   })
                                                                 End Sub)
    
                                          'Dispatcher.BeginInvoke(Sub()
                                          '                           DataGridAggregate.SetAggregateFunctions(colTEZASUR1, New DataGridAggregatesCollection From {
                                          '                               New DataGridAggregateSum With {.ResultFormat = "Skupaj = {0}"}
                                          '                           })
                                          '                       End Sub)
                                      End Sub
    
  • Posted 18 November 2025, 5:15 am EST

    Hi,

    We used the latest version of C1DataGrid to create a two-level group and added aggregates to it, similar to the code you shared, and it is working correctly on our end. Please see the attached sample project for reference.

    If you are encountering the issue with a different implementation, please update the same project to reproduce the problem so we can investigate further and assist you better.

    Attachment: DataGridAggregates.zip

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels