Unplanned
Last Updated: 19 Sep 2024 06:58 by ADMIN
Davide
Created on: 25 Nov 2021 08:35
Category: Grid
Type: Feature Request
29
Allow sorting the grouped column
I'd like to be able to sort the grouped column.
4 comments
ADMIN
Dimo
Posted on: 19 Sep 2024 06:58

Hi Andrew,

Yes, your thoughts are spot-on and this is what we will do. This feature has not been prioritized and scheduled for implementation yet, but it's relatively popular, so it's more likely to get planned sooner than later.

In the meantime, I hope it's feasible to reverse the group sort order programmatically, if users need it.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Andrew
Posted on: 18 Sep 2024 22:12

Any more thoughts on this? I've run across this problem recently.

I won't say, "it should be easy", but I will say this: It's ALREADY sorting, just in the wrong direction. When I move a column into the Group-By section at the top of a grid, the telerik grid SORTS by Ascending.

So obviously SOMEPLACE in the telerik code you're already doing the sorting and making a code choice to sort by Ascending.

This feature request is simply asking that when the user clicks the column header, that the already existing code just sort the other way around.

Just to clarify the request: if I have a grid with 4 columns:

ClientId     Name   Status   EffectiveDate

5    John   Completed    8/1/2024

5    John   Attending      7/30/2024

5    John   New             7/25/2024

3   Steve   Attending    7/30/2024

3   Steve   New            7/26/2024

 

Then when I Group by Client Id the table ends up looking like this:

ClientId     Name   Status   EffectiveDate

CLIENTID: 3

   3   Steve   Attending    7/30/2024

   3   Steve   New            7/26/2024

CLIENTID: 5

  5    John   Completed    8/1/2024

  5    John   Attending      7/30/2024

  5    John   New             7/25/2024

 

So, any further thoughts, considering you've already written the code to sort ascending and that's already live, please add a Descending toggle in that same spot of the existing code.

Thanks! :)

 

 

ADMIN
Svetoslav Dimitrov
Posted on: 27 Oct 2022 08:06

Hello Srihari,

The best way to be notified when the status of an item changes is to click the Follow button. You will receive an email when the status of the item changes. 

Until this feature is implemented, you can see the example from the Grid State article, the Set Grid Options Through State section, Grouping tab:

@using Telerik.DataSource;

<TelerikButton ThemeColor="primary" OnClick="@SetGridGroup">set grouping from code</TelerikButton>

<TelerikGrid Data="@MyData" Height="400px" @ref="@Grid" Groupable="true"
             Pageable="true" FilterMode="@GridFilterMode.FilterMenu">
    <GridColumns>
        <GridColumn Field="@(nameof(SampleData.Id))" Width="120px" />
        <GridColumn Field="@(nameof(SampleData.Name))" Title="Employee Name" />
        <GridColumn Field="@(nameof(SampleData.Team))" Title="Team" />
        <GridColumn Field="@nameof(SampleData.IsOnLeave)" Title="On Vacation" />
        <GridColumn Field="@(nameof(SampleData.HireDate))" Title="Hire Date" />
    </GridColumns>
</TelerikGrid>

@code {
    public TelerikGrid<SampleData> Grid { get; set; }

    async Task SetGridGroup()
    {
        GridState<SampleData> desiredState = new GridState<SampleData>()
        {
            GroupDescriptors = new List<GroupDescriptor>()
            {
                new GroupDescriptor()
                {
                    Member = "Team",
                    MemberType = typeof(string)
                },
                new GroupDescriptor()
                {
                    Member = "IsOnLeave",
                    MemberType = typeof(bool),
                    SortDirection = ListSortDirection.Descending // not required, but a feature not yet available through the UI
                }
            },
            // choose indexes of groups to be collapsed (they are all expanded by default)
            CollapsedGroups = new List<int>() { 0 },
        };

        await Grid.SetState(desiredState);
    }

    public IEnumerable<SampleData> MyData = Enumerable.Range(1, 30).Select(x => new SampleData
    {
        Id = x,
        Name = "name " + x,
        Team = "team " + x % 5,
        IsOnLeave = x % 2 == 0,
        HireDate = DateTime.Now.AddDays(-x).Date
    });

    public class SampleData
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Team { get; set; }
        public bool IsOnLeave { get; set; }
        public DateTime HireDate { get; set; }
    }
}

Regards,
Svetoslav Dimitrov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Nemo
Posted on: 20 Oct 2022 14:47
Hi, what's the status of this request?