Hello everyone,
Since 2.26 Blazor release, it is possible to configure the ButtonsCount in the Grid Pager through `GridPagerSettings` tag. You could observe the behavior on our demos site, or the repl snippet to test further:
https://blazorrepl.telerik.com/mQklvLvA00g9Y8vD53
https://demos.telerik.com/blazor-ui/grid/paging
Regards,
Joana
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Oemer,
If you use the OnRead event you should be able to get the correct TotalCount of the actual data source - it lets you take into account the searchbox input as the grid adds filter descriptors for it in the request - and so you can also update the Total of the pager to be correct.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Here's also a workaround that directly uses the pager component
<div class="custom-pager">
<TelerikGrid Data="@Data" Pageable="true" @bind-Page="@CurrentPage" PageSize="@PageSize" AutoGenerateColumns="true">
</TelerikGrid>
<TelerikPager Total="@Data.Count()" @bind-Page="@CurrentPage" PageSize="@PageSize" ButtonCount="3" />
</div>
@code {
int CurrentPage { get; set; } = 1;
int PageSize { get; set; } = 5;
IEnumerable<SampleData> Data { get; set; } = Enumerable.Range(1, 300).Select(x => new SampleData
{
Id = x,
Name = "name " + x,
Team = "team " + x % 5,
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 DateTime HireDate { get; set; }
}
}
<style>
/* hide the built-in grid pager */
.custom-pager .k-grid .k-pager-wrap {
display: none;
}
/* just to showcase how the wrapper contrls the width of both components since they are now separate */
.custom-pager{
width: 600px;
}
</style>
Perhaps a property similar to the Pager component's ButtonCount could be exposed on the grid as well.
Regards,
Marin Bratanov
Progress Telerik