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

[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

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

@pauldipietro pauldipietro added this to New in Triage Apr 3, 2019
@adrianknight89
Copy link
Contributor

Not sure if CollectionView supports ObservableRangeCollection.

https://github.com/jamesmontemagno/mvvm-helpers
https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091
https://forums.xamarin.com/discussion/29925/observablecollection-addrange

Looks like there is an internal ObservableList<T> with similar functionality.

@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
@samhouts samhouts moved this from New to Ready For Work in Triage Apr 8, 2019
@samhouts samhouts added this to To do in Other Ready For Work Apr 10, 2019
@samhouts samhouts removed this from Ready For Work in Triage Apr 10, 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

@samhouts samhouts removed this from Done in Other Ready For Work May 6, 2020
@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 added this to Review Backlog in CollectionView via automation Feb 11, 2021
@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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/collectionview a/listview Problems with the ListView/TableView e/6 🕕 6 t/bug 🐛
Projects
CollectionView
  
Review Backlog
v4.0.0
  
Done
Development

No branches or pull requests