DataGrid Reload after setting PageSize #101

Open
opened 2026-01-29 17:31:35 +00:00 by claunia · 0 comments
Owner

Originally created by @ghost on GitHub (May 24, 2021).

I setup a dataGrid like this:

<RadzenGrid AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterMode="FilterMode.Advanced" AllowPaging="true"
                AllowSorting="true" Data="@Model.CoronaViruses" LoadData="@((args) => LoadData(args))" Count="count" PageSize="pageSize" @ref="grid"
                TItem="CoronaVirusDTO">
   <Columns>
      ...
   </Columns>
</RadzenGrid>

I use filtering, sorting and paging in this grid, and use a pageSize variable that is set with a dropdown and then I want to go to first page and Reload the grid when the pageSize is set. like this:

async Task PageSize()  //<= this method is called from an Edit form with Page Size dropdown in it 
{            
    pageSize = PageSizeModel.PageSizeValue; //<= int that is set with a dropdown in an EditForm
    await grid.FirstPage(true);  //<= problem here 
    //await grid.Reload(); //<= without above "true" parameter and using this function also not worked
    StateHasChanged();            
}

after calling above method, dataGrid goes to the first page but the new page size is still the previous one, When I navigate to another page, page size suddenly works and shows correctly. What is the purpose of dataGrid's reload? should it send all args and load the component again? Is it a bug?

Originally created by @ghost on GitHub (May 24, 2021). I setup a dataGrid like this: ``` <RadzenGrid AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterMode="FilterMode.Advanced" AllowPaging="true" AllowSorting="true" Data="@Model.CoronaViruses" LoadData="@((args) => LoadData(args))" Count="count" PageSize="pageSize" @ref="grid" TItem="CoronaVirusDTO"> <Columns> ... </Columns> </RadzenGrid> ``` I use filtering, sorting and paging in this grid, and use a pageSize variable that is set with a dropdown and then I want to go to first page and Reload the grid when the pageSize is set. like this: ``` async Task PageSize() //<= this method is called from an Edit form with Page Size dropdown in it { pageSize = PageSizeModel.PageSizeValue; //<= int that is set with a dropdown in an EditForm await grid.FirstPage(true); //<= problem here //await grid.Reload(); //<= without above "true" parameter and using this function also not worked StateHasChanged(); } ``` after calling above method, dataGrid goes to the first page but the new page size is still the previous one, When I navigate to another page, page size suddenly works and shows correctly. What is the purpose of dataGrid's reload? should it send all args and load the component again? Is it a bug?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#101