DataList - Set CurrentPage must recompute skip #1484

Closed
opened 2026-01-29 17:54:17 +00:00 by claunia · 4 comments
Owner

Originally created by @tale80 on GitHub (Nov 18, 2024).

Describe the bug
When we set the CurrentPage of RadzenDataList component, skip value is not recomputed.

I have a data filter component which configure the request for a data list component.
Imagine that I have a configuration of 5 results per page, and my user go to page 5. Data list will set its internal skip value to 20 (skip 4 pages of 5). Now the user wants to make a new search, this search will return only 4 items. the data list will send to the server a request with skip = 20 + take = 5, so it will return no result.

We can't access property skip as it is protected

To Reproduce
Set a filter upon a RadzenDataList, change the page of the RadzenDataList and then change the filter. Results in RadzenDataList is bad

Expected behavior
We need a way to reset pagination of RadzenDataList.
A good way can be to have a binding on CurrentPage and not just a public property, and when CurrentPage changed, compute the new value for skip

Originally created by @tale80 on GitHub (Nov 18, 2024). **Describe the bug** When we set the CurrentPage of RadzenDataList component, skip value is not recomputed. I have a data filter component which configure the request for a data list component. Imagine that I have a configuration of 5 results per page, and my user go to page 5. Data list will set its internal skip value to 20 (skip 4 pages of 5). Now the user wants to make a new search, this search will return only 4 items. the data list will send to the server a request with skip = 20 + take = 5, so it will return no result. We can't access property skip as it is protected **To Reproduce** Set a filter upon a RadzenDataList, change the page of the RadzenDataList and then change the filter. Results in RadzenDataList is bad **Expected behavior** We need a way to reset pagination of RadzenDataList. A good way can be to have a binding on CurrentPage and not just a public property, and when CurrentPage changed, compute the new value for skip
Author
Owner

@enchev commented on GitHub (Nov 18, 2024):

There is no filter UI for RadzenDataList, where do we set the filter?

@enchev commented on GitHub (Nov 18, 2024): There is no filter UI for RadzenDataList, where do we set the filter?
Author
Owner

@tale80 commented on GitHub (Nov 18, 2024):

In my case for example, I have 2 searches : a simple search with a textbox and an advanced search with a full RadzenDataFilter component up to our RadzenDataList.

Only look at the simple mode as it is easier :

<RadzenTextBox Change="@(_ => _dataList.Reload())" @bind-Value="@searchValue" ></RadzenTextBox>

<RadzenDataList @ref="_dataList" LoadData=@LoadData>
...
<RadzenDataList>

client code side

private string searchValue;
private async Task LoadData(LoadDataArgs args)
{
    //Make your request on server using searchValue

}
@tale80 commented on GitHub (Nov 18, 2024): In my case for example, I have 2 searches : a simple search with a textbox and an advanced search with a full RadzenDataFilter component up to our RadzenDataList. Only look at the simple mode as it is easier : ```csharp <RadzenTextBox Change="@(_ => _dataList.Reload())" @bind-Value="@searchValue" ></RadzenTextBox> <RadzenDataList @ref="_dataList" LoadData=@LoadData> ... <RadzenDataList> ``` client code side ```csharp private string searchValue; private async Task LoadData(LoadDataArgs args) { //Make your request on server using searchValue } ```
Author
Owner

@enchev commented on GitHub (Nov 18, 2024):

Again , there is no UI for filtering in RadzenDataList. You have full control when and how is requested - for example you can call FirstPage() on search change. Use our forum in the future for such questions.

@enchev commented on GitHub (Nov 18, 2024): Again , there is no UI for filtering in RadzenDataList. You have full control when and how is requested - for example you can call FirstPage() on search change. Use our forum in the future for such questions.
Author
Owner

@tale80 commented on GitHub (Nov 18, 2024):

@enchev It's not a problem to make the search, it's a problem to change the page and reset the skip value.

You can see a similar trouble on the RadzenDataGrid component, but it seems that the grid "understand" that result count 1 and no result in the scope is not a normal state, so the grid try to decrease its skip value by the page size.

On your demo, go on DataFilter > OData, remove the existing filter and open your network console :
image

Copy the first Order ID (10248), then go on last page :
image

Now, add a filter with your first order id :
image

the grid make a lot of request to decrease the skip value :
image
image

Not the same behavior, but same problem. We can't reset the skip value before to start LoadData events of RadzenDataGrid & RadzenDataFilter

@tale80 commented on GitHub (Nov 18, 2024): @enchev It's not a problem to make the search, it's a problem to change the page and reset the skip value. You can see a similar trouble on the RadzenDataGrid component, but it seems that the grid "understand" that result count 1 and no result in the scope is not a normal state, so the grid try to decrease its skip value by the page size. On your demo, go on [DataFilter > OData](https://blazor.radzen.com/datafilter-odata?theme=material3), remove the existing filter and open your network console : ![image](https://github.com/user-attachments/assets/2e08003c-3b85-445b-8841-d7432f72678e) Copy the first Order ID (10248), then go on last page : ![image](https://github.com/user-attachments/assets/50edbbcd-1209-41ec-bd16-d83ae9342e31) Now, add a filter with your first order id : ![image](https://github.com/user-attachments/assets/63adb899-bb36-4626-b488-1d84ae764a45) the grid make a lot of request to decrease the skip value : ![image](https://github.com/user-attachments/assets/b22e817a-f415-4b08-9847-4fca156ed441) ![image](https://github.com/user-attachments/assets/3997c0c8-893e-4d37-92fc-d354d597eb1a) Not the same behavior, but same problem. We can't reset the skip value before to start LoadData events of RadzenDataGrid & RadzenDataFilter
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1484