Grid sorting descending

Dear team,
is it possible to sort a grid by date column descending?
I try this but without result

@code {
    ServiceResponse response;
    RadzenGrid<JobTransmissionModel> grid;
    List<JobTransmissionModel> data;

    protected override async Task OnInitializedAsync()
    {
        base.OnInitialized();
        response = await financeService.GetSkorzakTransmissionsAsync();
        data = new List<JobTransmissionModel>();
        data.AddRange(response.Models as List<JobTransmissionModel>);
        data.OrderByDescending(x => x.Date);
    }

    protected override void OnAfterRender(bool firstRender)
    {
        //if (firstRender) grid.OrderBy("Date");
    }

}

If I use grid.OrderBy("Date") I get ascending sorting.
Thanks and regards
Arne

Try grid.OrderBy("Date Desc")

Sorry but no effect. Should I send Grid part also?

Okay

protected override void OnAfterRender(bool firstRender)
{
    base.OnAfterRender(firstRender);
    if (firstRender)
        itemGrid.OrderBy("NrCNPJ");
}

No effect

protected override void OnAfterRender(bool firstRender)
{
    base.OnAfterRender(firstRender);
    if (firstRender)
        itemGrid.OrderBy("NrCNPJ desc");
}

No effect

protected override void OnAfterRender(bool firstRender)
{
    base.OnAfterRender(firstRender);
    if (firstRender)
        itemGrid.OrderBy("NrCNPJ DESC");
}

Hi,
sorry for the late response. Licitec - was that a question or a confirmation? I tried both (desc, DESC) but in both versions no more data is loaded. Here is my complete page.

@page "/distribution/zugferd/listinvoices"
@using Meesenburg.DataHub.Interfaces;
@using Meesenburg.BusinessClient.Services;
@using Meesenburg.BusinessClient.Models;
@inject DistributionService service;
@inject NotificationService notification;
@inject NavigationManager uriHelper;

<RadzenGrid @ref="grid" Data="@data" TItem="JobTransmissionModel" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowPaging="true" PageSize="20" AllowSorting="true" ColumnWidth="200px">
    <Columns>
        <RadzenGridColumn TItem="JobTransmissionModel" Property="Date" Title="Datum"></RadzenGridColumn>
        <RadzenGridColumn TItem="JobTransmissionModel" Property="Content" Title="Dokument"></RadzenGridColumn>
        <RadzenGridColumn TItem="JobTransmissionModel" Property="Receiver" Title="Empfänger"></RadzenGridColumn>
        <RadzenGridColumn TItem="JobTransmissionModel" Property="Email" Title="Email-Adresse"></RadzenGridColumn>
        <RadzenGridColumn TItem="JobTransmissionModel" Title="Status">
            <Template Context="item">
                <div>
                    @if (item.Status.Equals(JobTransmissionStatus.Sended))
                    {<span class="badge badge-primary">versendet</span>}
                    else if (item.Status.Equals(JobTransmissionStatus.CovertionFailed))
                    {<span class="badge badge-error">Fehler Konvertierung</span> }
                    else
                    { <span class="badge badge-error">Fehler Versand</span>}
                </div>
            </Template>
        </RadzenGridColumn>

    </Columns>
</RadzenGrid>

@code {
    RadzenGrid<JobTransmissionModel> grid;
    List<JobTransmissionModel> data;

    protected override async Task OnInitializedAsync()
    {
        base.OnInitialized();
        ServiceResponse response = await service.GetZUGFeRDInvoicesAsync();
        data = new List<JobTransmissionModel>();
        data.AddRange(response.Models as List<JobTransmissionModel>);
    }

    protected override void OnAfterRender(bool firstRender)
    {
        if (firstRender) grid.OrderBy("Date");
    }
}

Any idea?

We will do our best to release today better way to do this - i.e. new method OrderByDescending(string property). In the meantime you can order the collection bound to the DataGrid Data property.

That sounds good. I will wait for the new method
Thanks

It was a confirmation.
But it looks like the Radzen team is going to work on a new solution for that.

The method is already added and released

Okay !!!
It returned the result correctly.
Thank you very much.

protected override void OnAfterRender(bool firstRender)
{
    if (firstRender)
        itemGrid.OrderByDescending("NomeUnidadeSaude");
}

Sorry for the late response - different time zone. Works perfect, thanks for the quick implementation.