Datalist LastPage() issue

Hi Radzen :v:

I have a DataList component with PageSize="1". The data being bound to is in memory, initialized to an empty list. When adding items to the list, data.Add(...), I am trying to navigate to the last item by calling await datalist.LastPage().

This navigates to the second last page. I've tried calling await datalist.Reload() before navigating, to no avail. It seems the fields of the DataList are only being set after navigation.

I've sent through a sample project showing the behaviour.

Could you please take a look and assist?

Hi @damian_s,

We’ve not received your sample project, maybe it’s too big? Try to upload your project in a service like Google Drive and send us a link.

Sorry for that @enchev.
Link to it sent.

We cannot access the project you sent us.

I never set the permissions correctly :roll_eyes: I've resent it.

I've tried using the RadzenPager on it's own too, but with the same result.

Hi @damian_s,

We were able to reproduce the problem and we will do our best to provide fix for this before the end of this week.

1 Like

The lastest version of Radzen fixes the paging issue. Thank you!

But setting PagerPosition="PagerPosition.Top" now causes a null reference error. PagerPosition.Bottom and PagerPosition.TopAndBottom work fine.

Fixed immediately! The fix will be part of our next update early next week.

1 Like

Thank you for the quick fix!

Another small issue I've picked up, is when removing items from the list, I need to add the following for it to function correctly:

var position = Data.FindIndex(d => d == value);
Data.Remove(value);

if (position == Data.Count())
{
    await datalist0.PrevPage();
}

Without this the page displays no content when removing the last item in the list.

Happy to send a sample showing this if needed.

Thanks! We will provide fix for this as well in our next update.

1 Like

Hi @damian_s,

Unfortunately we will unable to provide fix for this. At the moment Radzen DataGrid will not monitor collection changes (nor the IList will raise such) and the code you've posted is the only way around the problem. Sorry for misleading you!

Hi @enchev,

Not a problem - I'll just keep using the workaround.
Thanks for clarifying.