Hi all,
In case anyone is interested, here is how to stick group headers during vertical scrolling. The suggestion works for one grouping level.
<TelerikGrid Data="@GridData"
TItem="@Employee"
Pageable="true"
PageSize="30"
Sortable="true"
Groupable="true"
Height="600px">
<GridColumns>
<GridColumn Field=@nameof(Employee.Name) />
<GridColumn Field=@nameof(Employee.Team) />
<GridColumn Field=@nameof(Employee.Salary) />
<GridColumn Field=@nameof(Employee.OnVacation) />
</GridColumns>
</TelerikGrid>
<style>
.k-grid .k-grouping-row {
position: static;
z-index: auto;
top: 0;
}
.k-grid .k-grouping-row td {
position: sticky;
z-index: 2;
top: inherit;
bottom: inherit;
}
</style>
@code {
List<Employee> GridData { get; set; }
protected override void OnInitialized()
{
GridData = new List<Employee>();
var rnd = new Random();
for (int i = 1; i <= 100; i++)
{
GridData.Add(new Employee()
{
Id = i,
Name = "Name " + i,
Team = "Team " + (i % 11 + 1),
Salary = (decimal)rnd.Next(1000, 3000),
OnVacation = i % 3 == 0
});
}
}
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public string Team { get; set; }
public decimal Salary { get; set; }
public bool OnVacation { get; set; }
}
}
Regards,
Dimo
Progress Telerik