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

Fixed Header and Footer template is not visible in CollectionView #26844

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Dec 27, 2024

Issue Details:

When both the HeaderTemplate and FooterTemplate are declared for a CollectionView, neither template is visible in the view.

Root Cause:

In the StructuredItemsView handler, the UpdateHeader() and UpdateFooter() methods return null for the Header property, resulting in the switch case returning null as well. Additionally, both the Header and MauiContext are found to be null when mapped to the native ListViewBase.Header, causing the header to fail to render properly

Description of Change:

Fixed by recalculating the Header value to account for both the Header and HeaderTemplate. Furthermore, the MauiContext was explicitly passed as a parameter to the ItemTemplateContext during the mapping process. This ensures that the MauiContext is properly associated with ListViewBase.Header, enabling the header to render as expected. Processed same for footer template in UpdateFooter()

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac

Issue not reproduced in iOS and macOS platforms as it is fixed by this PR #25418

Issues Fixed:

Fixes #22892

Screenshots

Before Issue Fix After Issue Fix

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 27, 2024
@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 30, 2024
@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review January 3, 2025 04:36
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner January 3, 2025 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS/Windows] CollectionView HeaderTemplate and FooterTemplate don't appear to work
3 participants