PageSize can't be changed with PageSize Dropdown when DataGrid has set PageSize and Settings is used. #1150

Closed
opened 2026-01-29 17:49:38 +00:00 by claunia · 3 comments
Owner

Originally created by @marekm294 on GitHub (Mar 3, 2024).

Describe the bug
Page size can't be changed (title of the bug)

To Reproduce
If you have RadzenDataGrid with these setting

PageSizeOptions="[10, 20, 40, 60]"
@bind-Settings="@DataGridSettings"

PageSize is correctly set when you change it in the dropdown.

But when you add PageSize value

PageSize="20"
PageSizeOptions="[10, 20, 40, 60]"
@bind-Settings="@DataGridSettings"

it's no more possible to change the value with the dropdown.
PageSIzeChanged is first called with correct value and then it's called again but with original value (there are two field in the code for one Property in this is probably causing the problem)

If load datasettings with page size different than PageSize set as "default" value

PageSize="20"
PageSizeOptions="[10, 20, 40, 60]"
@bind-Settings="@DataGridSettings"

the first page will use page size loaded from Settings.
But if you change Page, PageSize is automatically change to PageSize set as "default" (20 in this case).

Expected behavior**
PageSize can be set to and Settings can be used at the same time,

Originally created by @marekm294 on GitHub (Mar 3, 2024). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** Page size can't be changed (title of the bug) **To Reproduce** If you have RadzenDataGrid with these setting ``` PageSizeOptions="[10, 20, 40, 60]" @bind-Settings="@DataGridSettings" ``` PageSize is correctly set when you change it in the dropdown. But when you add PageSize value ``` PageSize="20" PageSizeOptions="[10, 20, 40, 60]" @bind-Settings="@DataGridSettings" ``` it's no more possible to change the value with the dropdown. PageSIzeChanged is first called with correct value and then it's called again but with original value (there are two field in the code for one Property in this is probably causing the problem) If load datasettings with page size different than PageSize set as "default" value ``` PageSize="20" PageSizeOptions="[10, 20, 40, 60]" @bind-Settings="@DataGridSettings" ``` the first page will use page size loaded from Settings. But if you change Page, PageSize is automatically change to PageSize set as "default" (20 in this case). Expected behavior** PageSize can be set to and Settings can be used at the same time,
Author
Owner

@enchev commented on GitHub (Mar 4, 2024):

PageSize should be bound to a variable and changed accordingly as well.

@enchev commented on GitHub (Mar 4, 2024): PageSize should be bound to a variable and changed accordingly as well.
Author
Owner

@marekm294 commented on GitHub (Mar 4, 2024):

@enchev I'd like to suggest to update demo where you show developers how should it work

@marekm294 commented on GitHub (Mar 4, 2024): @enchev I'd like to suggest to update demo where you show developers how should it work
Author
Owner

@enchev commented on GitHub (Mar 4, 2024):

Hey @marekm294,

You can check this demo:
https://blazor.radzen.com/datagrid-save-settings-loaddata

@enchev commented on GitHub (Mar 4, 2024): Hey @marekm294, You can check this demo: https://blazor.radzen.com/datagrid-save-settings-loaddata
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1150