Skip to content

Fix for Android - Dynamic Updates to CollectionView Header/Footer and Templates Are Not Displayed #28904

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SuthiYuvaraj
Copy link
Contributor

Issue Description:

  • Dynamic updates to CollectionView's Header/Footer (both text and views) are not adequately reflected on Android.
  • Changes to HeaderTemplate and FooterTemplate are also not applied correctly at runtime.

Root Cause:

  • ItemsViewPropertyChanged did not handle updates for HeaderTemplateProperty and FooterTemplateProperty.
  • OnBindViewHolder did not account for rendering updated header/footer content or templates.
  • Templated headers and footers were not properly managed when the content changed dynamically.

Description of Change

  • Added support for HeaderTemplateProperty and FooterTemplateProperty in the ItemsViewPropertyChanged method to ensure runtime changes are detected and processed.
  • Updated the OnBindViewHolder method to handle both simple views and string-based headers/footers using SimpleViewHolder.
  • Bind the correct templates when a header or footer is templated.
  • Enhanced BindTemplatedItemViewHolder to correctly create and bind TemplatedItemViewHolder for HeaderTemplate and FooterTemplate, ensuring updates are accurately reflected in the UI.

Issues Fixed

Fixes #28676

Tested the behaviour on the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before Issue Fix After Issue Fix
HeaderFooterBefore.mov
HeaderFooterFix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 10, 2025
Copy link
Contributor

Hey there @@SuthiYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 10, 2025
@jsuarezruiz jsuarezruiz added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android - Dynamic Updates to CollectionView Header/Footer and Templates Are Not Displayed
2 participants