DataGrid Sorting has no effect

Hi, I have a problem about sorting a column, I'm using the same code as in the demo, just with a different country in CultureInfo, basically sorting has no effect

<RadzenDataGrid AllowFiltering="true" AllowPaging="true" AllowSorting="true" Data="@esitiDett" TItem="Esiti" ColumnWidth="50px" @ref="grid" AllowColumnResize="true">
                <Columns>
                    <RadzenDataGridColumn TItem="Esiti" Property="CodCg" Title="Cod. Cg" />
                    <RadzenDataGridColumn TItem="Esiti" Property="CodAge" Title="Cod. Ag." />
                    <RadzenDataGridColumn TItem="Esiti" Property="Agente" Title="Agente" />
 <RadzenDataGridColumn TItem="Esiti" Title="Incentivo Agente">
                        <Template Context="esito">
                            @if (incentivo.UMBenefit == "VENDUTO")
                            {
                                @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", esito.ImportoRiga * incentivo.PercBenefit/100)
                            }
                            else
                            {
                                @if (incentivo.TipoTarget.ToUpper() == "AZIENDALE")
                                {

                                    if (incentivo.UMBenefit == "FISSO")
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}",  incentivo.EuroBenefit)
                                    }
                                    else
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", Math.Floor(esito.Cartoni * incentivo.EuroBenefit))

                                    }
                                }
                                else
                                {
                                    if (incentivo.UMBenefit == "FISSO")
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}",  incentivo.EuroBenefit)
                                    }
                                    else
                                    {
                                    
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C}", esito.importoBenefit)
                                    }
                                }
                            }
                        </Template>
                        <FooterTemplate>
                            @if (incentivo.UMBenefit == "VENDUTO")
                            {
                                @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", esitiDett.Sum(e => e.ImportoRiga* incentivo.PercBenefit/100))
                            }
                            else
                            {
                                @if (incentivo.TipoTarget.ToUpper() == "AZIENDALE")
                                {
                                    if (incentivo.UMBenefit == "FISSO")
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", incentivo.EuroBenefit * incentivo.Per_I_Primi)
                                    }
                                    else
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", Math.Floor(esitiDett.Sum(e =>e.Cartoni)) * incentivo.EuroBenefit)
                                    }
                                }
                                else
                                {
                                    if (incentivo.UMBenefit == "FISSO")
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", incentivo.EuroBenefit * incentivo.Per_I_Primi)
                                    }
                                    else
                                    {
                                        @String.Format(new System.Globalization.CultureInfo("it-IT"), "{0:C2}", esitiDett.Sum(e => e.importoBenefit))
                                    }
                                }
                            }
                        </FooterTemplate>
                    </RadzenDataGridColumn>
  </Columns>
            </RadzenDataGrid>

Hi @Carmine_Tesone,

Your code seems correct. We would need additional information about the problem:

  1. What is esitiDett?
  2. Are there any exceptions during sorting?
  3. What column are you sorting by?
  4. Does sorting work for any other column?

... of course,

  1. esitiDett is a IEnumerable esitiDett and the field where I set the value (importoBenefit) is a double.

  2. No

  3. 4th column Title="Incentivo Agente"

  4. No, sorting on column where I format in € not work in all my DataGrid in this web app, I have another web app where sorting on Euro value working well and the Radzen Version is 3.16.1.

We will need a runnable code snippet to troubleshoot further. Try creating one with inline data.

Sorting is performed at data level and templates, string formats, cultures, etc. are not relevant.

Solved, there wasn't any Property value for that Column, I've added one, and now work fine. Thank you