On the click of menu icon my arraylists gets populated and I call adapter.notifydatasetchanged()
Arraylist count keeps on varying. When I launch my application arraylist count is 1, and on the tap of button arraylist is changed and now its count is 4, but on the call of notifydatasetchanged app crashes giving error (IndexOutOf BoundException : Index1, seize 1).
Kindly suggest a solution on priority.
7 Answers, 1 is accepted
Thank you for contacting us on that matter. We would really like to assist you on your way. Could you please provide a project demonstrating the issue you encounter? It is difficult to understand the exact implementation based on the provided explanation. Once you do this we will be able to better understand your setup and assist you on your way.
Regards,
Pavel R. Pavlov
Telerik by Progress
Following is the link of the project:
https://github.com/dipankar2308/TelerikListViewSample
In this the (Buckets_CollectionChanged) on MainActivity crashes when listview count changes.
With the following line, crash doesn't happen but is it a correct way to do ? because the list that I am using is ObservableCollection and the collectionchange method is called each time an item is added or deleted.
mSampleAdapter.Items = mViewModel.Buckets;
Thank you for contacting us! I can confirm that we were able to reproduce the issue from our side. We will dig deeper and make sure to resolve the issue in on of our future releases.
On a side note, can you elaborate why the explicit call of notifydatachanged is required. Basically the control can handle changes in the items source and updates its view accordingly.
Regards,
Tsvyatko
Telerik by Progress
We have to call notifydatachanged otherwise data is not getting updated in the listview.
Even in other scenarios in my project when only one item of the listview changes still the list doesnt refresh without calling notifydatasetchanged
Please let me know if there is any solution for the same.
Thank you for the sample provided. We will have a more detailed look at the behavior and update you once we have more information.
Regards,
Stefan Nenchev
Progress Telerik
We have investigated the behavior and can confirm that it is a bug in the native implementation of the RadListView. It is logged in our internal system and you can track its progress on the following link from our Ideas & Feedback Portal - ListView: Control not updating items on NotifyDataSetChanged when bound to ObservableCollection. I suggest you subscribe to the item by following it in order to receive further notifications regarding its development. I have also added some points to your account for reporting the issue.
Regards,
Stefan Nenchev
Progress Telerik