We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

sort summary child rows

Thread ID:





110814 Aug 26,2013 09:05 PM UTC Aug 30,2013 04:12 AM UTC WinForms 1
Tags: GridControl
Felipe Bahiana Almeida
Asked On August 26, 2013 09:05 PM UTC

Hello, I have one syncfusion GridGroupingControl which I have some grouped columns with custom summaries appearing when the groups are collapsed. I am trying to sort the column by both the summary and the child rows.

In order to have the columns sorted by the summary. I used the following code in the routine that handles the event TableControlQueryAllowSortColumn of the control:

' tem coluna agrupando?
            If (Me.TableDescriptor.GroupedColumns.Count > 0) Then

                ' pega a coluna clicada
                _ColunaNomeClicada = e.Column.FieldDescriptor.Name

                ' coluna clicada está no conjunto de colunas sumarizadas?
                If (Me.TableDescriptor.SummaryRows.Count > 0) AndAlso _
                    (Me.TableDescriptor.SummaryRows.Item(0).SummaryColumns.Contains(_ColunaNomeClicada) = True) Then

                    ' pega a coluna sumarizada
                    _ColunaSumarizada = Me.TableDescriptor.SummaryRows.Item(0).SummaryColumns(_ColunaNomeClicada)

                    ' determina o nome da propriedade de sumarizacao
                    ' de acordo com o tipo de sumarizacao
                    Select Case _ColunaSumarizada.SummaryType
                        Case SummaryType.Custom
                            _PropriedadeSumarizacao = "Valor"
                        Case SummaryType.DoubleAggregate
                            _PropriedadeSumarizacao = "Sum"
                        Case Else
                            _PropriedadeSumarizacao = "Sum"
                    End Select ' de acordo com o tipo de sumarizacao

                    ' eh a coluna que esta na ordenacao?
                    If (Me.TableDescriptor.SortedColumns.Count > 0) AndAlso _
                        (Me.TableDescriptor.SortedColumns.Contains(_ColunaSumarizada.Name) = True) Then

                        ' verifica a ordenacao atual
                        If (Me.TableDescriptor.SortedColumns.Item(_ColunaSumarizada.Name).SortDirection = System.ComponentModel.ListSortDirection.Ascending) Then
                            _ColunaDirecaoOrdenacao = System.ComponentModel.ListSortDirection.Descending
                            _ColunaDirecaoOrdenacao = System.ComponentModel.ListSortDirection.Ascending
                        End If ' coluna tem uma tag com a ordenacao?

                    End If ' eh a coluna que esta na ordenacao?

                    ' percorre colunas agrupadas
                    For Each _ColunaOrdenacao In Me.TableDescriptor.GroupedColumns
                        ' coloca a ordenacao definida para todos os niveis de agrupamento
                        _ColunaOrdenacao.SetGroupSummarySortOrder( _
                            _ColunaSumarizada.GetSummaryDescriptorName, _
                            _PropriedadeSumarizacao, _
                    Next ' percorre colunas agrupadas

it solves the problem of sorting by the summary values but not the children rows. This code is found in many syncfusion samples and forum posts.

Arun Kumar V [Syncfusion]
Replied On August 30, 2013 04:12 AM UTC

Hi Felipe Bahianana almeida,

Thanks for your interest in Syncfusion products.


Sort summary child rows.

To sort the grid from top level to the bottom level you can make use of the following form link which replicates your inquiry.


If the reported behavior could not be achieved please provide me your essential studio version, and the sample file you have customized. So that I can modify it and provide you.

Please let me know if you have any concerns.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon