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

[Windows] ListView ItemsSource refreshing throws error after 60+ items #6905

Closed
rachelkang opened this issue May 6, 2022 · 3 comments
Closed
Assignees
Labels
area-controls-listview ListView and TableView area-controls-refreshview RefreshView p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/no-repro Can no longer be reproduced on latest s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@rachelkang
Copy link
Member

Description

This issue describes point 1 of #6377

Windows can't display more than 60ish item in ListView, trying to put 65 objects list as ItemsSource crashes Windows app with
System.Runtime.InteropServices.COMException: '0x88000FA8'
On android app this does not happen and I tried 80 objects in list and it showed them all.

Repro: https://github.com/dotnet/maui/files/8536434/MauiApp3.zip

Steps to Reproduce

  1. Download https://github.com/dotnet/maui/files/8536434/MauiApp3.zip and open in VS
  2. Run the project on Windows
  3. When the app launches, click on the button 60+ times
  4. See the System.Runtime.InteropServices.COMException: '0x88000FA8' error thrown

Version with bug

Release Candidate 3

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

WinUI

Did you find any workaround?

No response

Relevant log output

No response

@rachelkang rachelkang added t/bug Something isn't working s/needs-verification Indicates that this issue needs initial verification before further triage will happen platform/windows 🪟 legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor fatal area-controls-listview ListView and TableView s/verified Verified / Reproducible Issue ready for Engineering Triage area-controls-refreshview RefreshView and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 6, 2022
@rachelkang rachelkang added this to the 6.0.300-servicing milestone May 6, 2022
@DavidCarKc
Copy link

Possible workaround:

  1. declare empty ObservableCollection
    ObservableCollection collection = new ObservableCollection();
  2. change if (answer) line to:
    if (answer) {
    while (collection.Count > 0) { collection.RemoveAt(0); }
    foreach (SmallObject smallObject in smallList) {
    collection.Add(smallObject);
    }
    collectionView1.ItemsSource = collection; }

Now it will display 100+ items but this won't work properly on android if you try to refresh the list after displaying it once.

If you try to get the whole 60+ items list in the declatation of the OC then the windows app will crash on trying to display it.

if (answer) { ObservableCollection collection = new ObservableCollection(smallList); collectionView1.ItemsSource = collection; }

Also possible workaround: adding new objects instead to the list, directly to ObservableCollection, but then after first refresh it will autorefresh after each added object.
Also possible: Using CollectionView instead of ListView

PS
I just don't understand why is it called ListView if it has so many problems displaying lists.

@hartez hartez changed the title [Windows] ListView ItemsSource refreshing throws error after 60+ times [Windows] ListView ItemsSource refreshing throws error after 60+ items May 11, 2022
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jul 12, 2022
@hartez hartez removed the fatal label Aug 1, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@samhouts samhouts modified the milestones: Backlog, .NET 8 Planning Jan 26, 2023
@rmarinho
Copy link
Member

rmarinho commented Apr 4, 2023

I have tested this and it's not a issue anymore.

@rmarinho rmarinho closed this as completed Apr 4, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2023
@samhouts samhouts added the s/no-repro Can no longer be reproduced on latest label May 12, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-listview ListView and TableView area-controls-refreshview RefreshView p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/no-repro Can no longer be reproduced on latest s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants