Skip to content

[CV2] Header/Footer removed at runtime leaves empty space and EmptyView not resized in CollectionView #31899

@devanathan-vaithiyanathan

Description

Description

In CV2, when the Header or Footer of a CollectionView is set to null at runtime, the header/footer area remains as an empty gap and the EmptyView is not resized to use the freed space. This issue does not occur in CV1 — CV1 removes the layout space correctly when header/footer are cleared.

Steps to Reproduce

1.Create a CollectionView with Header, Footer, and EmptyView.
2.Ensure ItemsSource is empty so EmptyView is visible.
3.At runtime set collectionView.Header = null; or collectionView.Footer = null;.
4.Observe layout after the change.

<CollectionView x:Name="cv" ItemsSource="{Binding Items}">
  <CollectionView.Header>
    <Label Text="Header" />
  </CollectionView.Header>

  <CollectionView.EmptyView>
    <Label Text="No items" />
  </CollectionView.EmptyView>

  <CollectionView.Footer>
    <Label Text="Footer" />
  </CollectionView.Footer>
</CollectionView>

Expected behavior

When Header or Footer is set to null, the corresponding layout space should be removed immediately and the EmptyView layout should adjust (resize/reflow) to occupy the resulting space.

Actual behavior

After clearing Header/Footer, an empty gap remains where the header/footer was, and the EmptyView is not resized to fill the freed area.

Link to public reproduction project repository

No response

Version with bug

9.0.110 SR11

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewcollectionview-cv2p/0Work that we can't release withoutpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions