Unplanned
Last Updated: 26 Sep 2020 08:23 by ADMIN
Jan Hindrik
Created on: 26 Sep 2020 08:23
Category: Grid
Type: Feature Request
1
Ability to not render certain grouping templates per level

For example, when I have two levels of grouping, I want to render only the inner footer templates, but not the outer.

While this is possible with some CSS like the snippet below, this does not scale well, and does not work well for arbitrary number of groups

<style>
    .k-group-footer + .k-group-footer {
       display:none;
    }
</style>

Group by the Vacation and Team columns to see the effect

<TelerikGrid Data=@GridData Groupable="true" Pageable="true">
    <GridColumns>
        <GridColumn Field=@nameof(Employee.Name) Groupable="false" />
        <GridColumn Field=@nameof(Employee.Team) Title="Team">
            <GroupFooterTemplate>
                Team group footer
            </GroupFooterTemplate>
        </GridColumn>
        <GridColumn Field=@nameof(Employee.IsOnLeave) Title="On Vacation">
            <GroupFooterTemplate>
                IsOnLeave group footer
            </GroupFooterTemplate>
            </GridColumn>
    </GridColumns>
</TelerikGrid>

@code {
    public List<Employee> GridData { get; set; }

    protected override void OnInitialized()
    {
        GridData = new List<Employee>();
        var rand = new Random();
        for (int i = 0; i < 15; i++)
        {
            GridData.Add(new Employee()
            {
                EmployeeId = i,
                Name = "Employee " + i.ToString(),
                Team = "Team " + i % 3,
                IsOnLeave = i % 2 == 0
            });
        }
    }

    public class Employee
    {
        public int EmployeeId { get; set; }
        public string Name { get; set; }
        public string Team { get; set; }
        public bool IsOnLeave { get; set; }
    }
}

0 comments