Skip to content

Android : RemainingItemsThresholdReachedCommand not firing when CollectionVew has Header and Footer both defined #29588

@MGohil

Description

@MGohil

Description

In Android platform, when we have set Header and Footer both for the CollectionVew, the RemainingItemsThresholdReachedCommand is not firing.

This happens only in Android platform, iOS works good.

This was working in .net8.0, caused when migrated to .net9.0

If we remove either Header or Footer, the this command is firing.

Recordings of 3 cases:

Header and Footer both are set:

Header.and.Footer.both.set.mov

Only Footer is set:
https://github.com/user-attachments/assets/7414588e-d99a-4339-b9b2-722ad2bf4728

Only Header is set:
https://github.com/user-attachments/assets/d844bcd6-b96c-493d-8269-6d74ec2f83ee

Steps to Reproduce

  1. Create .NET Maui project.
  2. Add following CollectionView code to a page.
<CollectionView
        ItemsLayout="VerticalList"
        ItemsSource="{Binding Items}"
        RemainingItemsThreshold="1"
        RemainingItemsThresholdReachedCommand="{Binding RemainingItemReachedCommand}"
        SelectionMode="None">
        <CollectionView.Header>
            <Grid BackgroundColor="Bisque">
                <Label
                    Margin="20,30"
                    FontSize="22"
                    Text="CollectionView does not fire RemainingItemsThresholdReachedCommand when Header and Footer both are set." />
            </Grid>
        </CollectionView.Header>
        <CollectionView.ItemTemplate>
            <DataTemplate>
                <Label
                    Margin="20,30"
                    FontSize="25"
                    Text="{Binding .}" />
            </DataTemplate>
        </CollectionView.ItemTemplate>
        <CollectionView.Footer>
            <ActivityIndicator
                Margin="0,20"
                IsRunning="{Binding IsLoadingMore}"
                IsVisible="{Binding IsLoadingMore}" />
        </CollectionView.Footer>
    </CollectionView>
  1. Load Items as ObservableCollection<string> Items
  2. Scroll to the bottom and you will notice that the RemainingItemsThresholdReachedCommand is not hitting.

Now either comment out Header or Footer and scroll to the bottom, the RemainingItemsThresholdReachedCommand will fire.

Link to public reproduction project repository

No response

Version with bug

9.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

Android

Affected platform versions

Android

Did you find any workaround?

Either remove Header or Footer if both are set in CollectionView.
There is no any other workaround I know yet.

The drawback is, if we have ActivityIndicator or Load More button in Footer, it will not be visible if we remove footer.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewi/regressionThis issue described a confirmed regression on a currently supported versionp/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidregressed-in-9.0.30s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions