Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[CollectionView/ListView] Not listening for Reset command #5793

Open
xamadev opened this issue Apr 3, 2019 · 12 comments
Open

[CollectionView/ListView] Not listening for Reset command #5793

xamadev opened this issue Apr 3, 2019 · 12 comments
Labels
a/collectionview a/listview Problems with the ListView/TableView e/6 🕕 6 t/bug 🐛

Comments

@xamadev
Copy link

xamadev commented Apr 3, 2019

Description

See issue: jamesmontemagno/mvvm-helpers#39

Basic Information

Xamarin.Forms 3.6.0.264807
Visual Studio 2017 Version 15.9.10
Platforms:
iOS Simulator with iOS 12.1 (iPhone SE)

Reproduction Link

https://github.com/xamadev/ObservableRangeCollectionError

@adrianknight89
Copy link
Contributor

@wcoder
Copy link

wcoder commented Apr 7, 2019

The same issue with ListView (for ObservableRangeCollection from mvvm-helpers), replacing to ObservableCollection - works correctly.

@samhouts samhouts added a/listview Problems with the ListView/TableView i/low Has trivial workaround; affects very few users labels Apr 8, 2019
@samhouts samhouts changed the title [CollectionView] ObservableRangeCollection<T>.ReplaceRange not recognized [CollectionView/ListView] Not listening for Reset command Apr 8, 2019
@samhouts samhouts added the e/6 🕕 6 label Apr 8, 2019
@pfedotovsky
Copy link

I get the following error while using ObservableCollection with CollectionView

Objective - C exception thrown. Name: NSInternalInconsistencyException Reason: Invalid update: invalid number of items in section 0.The number of items contained in an existing section after the update(13) must be equal to the number of items contained in that section before the update(13), plus or minus the number of items inserted or deleted from that section (13 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section(0 moved in, 0 moved out).

@adrianknight89
Copy link
Contributor

@pfedotovsky This error usually happens (on iOS) when items are NOT being added to the underlying adapter/data source on the main thread.

@jamesmontemagno
Copy link
Contributor

Seems to work just fine on Android, which is interesting......

@samhouts samhouts removed the i/low Has trivial workaround; affects very few users label May 4, 2019
@hartez
Copy link
Contributor

hartez commented May 4, 2019

Seems to work just fine on Android, which is interesting......

Oh, I see what y'all are talking about now. Yes, Android does a NotifyDataSetChanged on Reset. Looks like I forgot to call ReloadData on iOS. Fix incoming ...

@Thanghand
Copy link

This issue still existed. Could you check again please ?

@hartez
Copy link
Contributor

hartez commented Jul 16, 2019

@Thanghand Which version of Forms are you using?

@afk013
Copy link

afk013 commented Jul 19, 2019

I am also still having this issue with a collection view. I am using Xamarin.Forms 4.1.0.581479.

Initially the observable collection is empty, then when new data arrives I call Clear and then add the new items.

I have also tried initialising the collection with some items and then calling reset with new items. The initial items display correctly but the new items cause the same error. Here is an Example Repo.

EDIT1: I have tested using the latest pre-release currently available (4.2.0.608146-pre1) and the issue still persists.

@EvoPulseGaming
Copy link

Also testing on the latest preview (due to bug in stable for android) and I have the same issue in ios now
4.4.0.991210-pre2

@Bohirjon
Copy link

Bohirjon commented Jul 7, 2020

It's still happening on 4.7.0.1080(latest).

@abdul-wasey
Copy link

It's still happening on 4.8.0.1687.

@hartez hartez reopened this Feb 11, 2021
@hartez hartez self-assigned this Feb 11, 2021
@hartez hartez removed their assignment Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/collectionview a/listview Problems with the ListView/TableView e/6 🕕 6 t/bug 🐛
Projects
None yet
Development

No branches or pull requests