Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataPager sample #204

Open
agriffard opened this issue Apr 12, 2024 · 3 comments
Open

DataPager sample #204

agriffard opened this issue Apr 12, 2024 · 3 comments

Comments

@agriffard
Copy link
Contributor

agriffard commented Apr 12, 2024

Could you please give an example with a DataPager component outside of a Grid (from an other library than this one)?

I am trying to bind a pager to a Grid component and I run into this error:

DataSizer requires a cascading parameter PagerState.

Thank you.

@agriffard
Copy link
Contributor Author

agriffard commented Apr 12, 2024

I added this in the razor.cs :

public DataPagerState Pager { get; } = new();

and surrounded the DataPager with a CascadingValue:

<CascadingValue IsFixed="true" Value="Pager" Name="PagerState">
    <DataPager PageSize="10" PagerChanged="PageChanged" />
    <DataSizer />
</CascadingValue>

but only the page sizer is displayed.

@agriffard
Copy link
Contributor Author

Ok, I think I figured it out.

I forgot to set the Pager.Total.

It works better now.

@agriffard
Copy link
Contributor Author

I have a remaining issue though :
The PageChanged event is not triggered when I select a page in the pagination.

It is only triggered when I change the PageSize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant