@Denny
>> if you need to show me a list at least make it a list of things requested that have not been completed....
My previous reply contains that list too: https://feedback.telerik.com/blazor?listMode=Popular&typeId=2&categoryId=1992&statusId=4
There are currently two ways to obtain the Grid page size without having it in the Grid state:
Let me know if you need more information.
@using Telerik.DataSource
@using Telerik.DataSource.Extensions
<p>Grid Page Size from parameter: <strong>@GridPageSize</strong></p>
<p>Grid Page Size from OnRead event: <strong>@GridPageSizeFromOnRead</strong></p>
<TelerikGrid OnRead="@OnGridRead"
TItem="@Product"
FilterMode="GridFilterMode.FilterRow"
Pageable="true"
@bind-PageSize="@GridPageSize"
Sortable="true"
Height="400px">
<GridSettings>
<GridPagerSettings PageSizes="@( new List<int?> { null, 10, 20, 50 } )" />
</GridSettings>
<GridColumns>
<GridColumn Field="@nameof(Product.Name)" />
<GridColumn Field="@nameof(Product.Group)" />
<GridColumn Field="@nameof(Product.Price)" DisplayFormat="{0:c2}" />
<GridColumn Field="@nameof(Product.Quantity)" DisplayFormat="{0:n0}" />
<GridColumn Field="@nameof(Product.Released)" DisplayFormat="{0:d}" />
<GridColumn Field="@nameof(Product.Discontinued)" />
</GridColumns>
</TelerikGrid>
@code {
private List<Product> GridData { get; set; } = new();
private int GridPageSize { get; set; } = 10;
private int GridPageSizeFromOnRead { get; set; }
private async Task OnGridRead(GridReadEventArgs args)
{
GridPageSizeFromOnRead = args.Request.PageSize;
DataSourceResult result = await GridData.ToDataSourceResultAsync(args.Request);
args.Data = result.Data;
args.Total = result.Total;
args.AggregateResults = result.AggregateResults;
}
protected override void OnInitialized()
{
var rnd = Random.Shared;
for (int i = 1; i <= 77; i++)
{
GridData.Add(new Product()
{
Id = i,
Name = $"Name {i} {(char)rnd.Next(65, 91)}{(char)rnd.Next(65, 91)}",
Group = $"Group {i % 3 + 1}",
Price = rnd.Next(1, 100) * 1.23m,
Quantity = rnd.Next(0, 10000),
Released = DateTime.Today.AddDays(-rnd.Next(60, 1000)),
Discontinued = i % 4 == 0
});
}
}
public class Product
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Group { get; set; } = string.Empty;
public decimal Price { get; set; }
public int Quantity { get; set; }
public DateTime Released { get; set; }
public bool Discontinued { get; set; }
}
}
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.
@Denny This is hitting my email as its an issue I voted on, and I haven't used Telerik in years. From time to time I get updates on other issues I posted / voted on also.
Its genuinely insane to me how slowly things get fixed etc when there are blatant issues with Telerik Blazor UI, which is a big part of why I stopped using Telerik.
Not super helpful unfortunately, but my ultimate advice is that if there are issues with Telerik that are important enough to you, your best bet is looking elsewhere.
and the comment from admin gives me a list of requested features that goes back and lists completed features over 4 years old....
if you need to show me a list at least make it a list of things requested that have not been completed....
but that still leaves the same problem, page size *IS* part of the "State" of the grid. page number is in that state.
without the page size the page number is almost of no use or value.
to go to "Page #x" you need to be able to setup a data query that knows how many rows to skip which is based on page size.
i am not doing that right now but that is one of the ways the current grid state is lacking.
for now i am having to capture the size and page size changes so that i can add this to the state data.
so i do have a work around for this but this has been requested for over 5 years now...
Hi Denny,
I understand your point of view and the urge to have a PageSize property in the Grid state. I can add two quick notes on the matter:
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.
so it looks like from 2020 to 2025 this has been requested and not done.... ok i get it this is a big thing to ask for to add 1 int to the grid state - wow thats hard!
I also see the first comment in this from 2020 saying that it was not a thing the user could select, that is not true today....
also the grid state save the page number and a skip value but without the page size they are not useable.
seems like this should be re-evaluated and implemented ,,,,
Hello Ryan,
For the time being, I confirm that we are focusing on other tasks. When we schedule this one for implementation, its status will change and you will receive a notification (I assume that you are following it).
In the meantime, I hope it's feasible to save and restore the PageSize separately.
Regards,
Dimo
Progress Telerik
Hi Timothy,
The Grid now allows the user to change the PageSize, so I agree the feature request is now more applicable than when it was submitted. We will prioritize it depending on customer demand.
In the meantime, it is possible to serialize and save separately additional Grid information (which is not in the state) and then restore it programmatically.
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.
The PageSize of the grid is not something the user can change through the grid UI and as such it is not part of its state. Nevertheless, I can see value in it being added to the state.
<<
The PageSize of the grid is not something the user can change through the grid UI and as such it is not part of its state. Nevertheless, I can see value in it being added to the state.
Regards,
Marin Bratanov
Progress Telerik