Skip to content

Fix inconsistent Grouped CollectionView (GridItemsLayout) rendering on Windows and iOS/macOS - #36561

Merged
kubaflo merged 7 commits into
dotnet:inflight/currentfrom
Shalini-Ashokan:fix-35700-Windows
Jul 20, 2026
Merged

Fix inconsistent Grouped CollectionView (GridItemsLayout) rendering on Windows and iOS/macOS#36561
kubaflo merged 7 commits into
dotnet:inflight/currentfrom
Shalini-Ashokan:fix-35700-Windows

Conversation

@Shalini-Ashokan

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

Grouped  CollectionView  with  GridItemsLayout  (Span > 1,  VerticalItemSpacing  set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items.

Root Cause

Windows: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row.

iOS/macOS: The grid layout path ( CreateGridLayout -equivalent) never set  InterSectionSpacing / ContentInsets  for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path.

Description of Change

Windows: Added  VerticalContentAlignmentProperty = VerticalAlignment.Stretch  to the item container style in  StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content.

iOS/macOS: Extracted the header/footer boundary-spacing logic into a shared  ApplyHeaderFooterBoundarySpacing  helper in  LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set  layoutConfiguration.InterSectionSpacing  using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections.

Validated the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #36545

Output ScreenShot

Windows

Before After
image image

iOS

Before After
image image

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Jul 14, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@Shalini-Ashokan! 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 Jul 14, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Shalini-Ashokan Shalini-Ashokan changed the title [inflight regression] Fix inconsistent Grouped CollectionView (GridItemsLayout) rendering on Windows and iOS/macOS Fix inconsistent Grouped CollectionView (GridItemsLayout) rendering on Windows and iOS/macOS Jul 14, 2026
@dotnet dotnet deleted a comment from azure-pipelines Bot Jul 14, 2026
@Shalini-Ashokan
Shalini-Ashokan changed the base branch from inflight/candidate to main July 14, 2026 11:27
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36561

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36561"

@sheiksyedm
sheiksyedm marked this pull request as ready for review July 14, 2026 11:51
Copilot AI review requested due to automatic review settings July 14, 2026 11:51
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a grouped CollectionView + GridItemsLayout rendering inconsistency by aligning layout spacing/measurement behavior across Windows and iOS/macOS handlers.

Changes:

  • Windows: Ensure GridViewItem content stretches vertically so the first item in a grouped grid row doesn’t collapse to content size.
  • iOS/macOS: Apply header/footer boundary spacing logic to the grid compositional layout path (and set InterSectionSpacing) so grouped headers get the expected gap before the first row.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs Extracts and reuses header/footer boundary spacing logic; adds inter-section spacing for grouped grid layouts.
src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs Adds vertical content stretching to the grid item container style to keep item sizing consistent in grouped grids.

Comment thread src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs Outdated
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 14, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 findings

See inline comments for details.

Comment thread src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs Outdated
@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jul 14, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 14, 2026
kubaflo pushed a commit that referenced this pull request Jul 15, 2026
…dout)

The per-category idle-watcher (Invoke-BuildScriptBounded) only measured growth
of the child's redirected stdout/stderr. VSTest's `dotnet test` console output
is block-buffered by the OS when stdout is a redirected file, so an actively-
running category could go >25 min without the watched file growing and get
tree-killed as a 'hang' with ZERO results — even though tests were running the
whole time. Confirmed on Windows/WinAppDriver #36561 and #33007: the Appium log
recorded findElements requests up to ~1 s before the kill, and screenshots/diffs
were produced, yet build-output.log had not grown since the `dotnet test` line.

Also count growth of the live UI-test artifacts (Appium log + screenshots in
CustomAgentLogsTmp/UITests, and the TRX results dir) as progress. Appium appends
to its log on every WinAppDriver request, so it grows continuously while tests
actually run — immune to stdout buffering. A genuine hang (no stdout AND no
artifact activity) is still idle-killed; validated with a two-scenario harness.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 findings

See inline comments for details.

Comment thread src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue35700.cs Outdated
kubaflo pushed a commit that referenced this pull request Jul 18, 2026
…kout

The 'Post review-incomplete notice' fallback dot-sourced
Remove-StaleMauiBotComments.ps1 from the relative .github path, which on a
merge-CONFLICTED PR is the PR HEAD checkout. When that PR branch predates
commit 0d1190f (added -IncludeReviewIncomplete), the collapse call failed
at runtime with 'A parameter cannot be found that matches parameter name
IncludeReviewIncomplete', so prior review-incomplete notices never got
collapsed and stacked on repeated conflicted-PR reviews.

Source instead from the tamper-proof pipeline-ref copy at
$(Build.ArtifactStagingDirectory)/trusted-github/scripts/shared/... (captured
in Setup before branch switching, same convention as every -TrustedScriptsDir
phase), so the current-branch function with the param is always loaded.
Observed on build 14698246 (conflicted #36561).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 19, 2026
@MauiBot

This comment has been minimized.

@MauiBot

This comment has been minimized.

@kubaflo

This comment has been minimized.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 19, 2026
kubaflo pushed a commit that referenced this pull request Jul 19, 2026
…xit code

The snapshot-diff image embed (best-effort) runs native commands (gh/git).
When the maui-bot PAT lacks the 'gist' scope, `gh api gists` fails and leaves
$LASTEXITCODE non-zero. On a gate-FAILED PR the Post job takes the deferred /
no-PRAgent branch, which runs no later native command to reset it, so the whole
"Post AI summary review" task inherited exit code 1 and failed (deep results
never posted). Reset $LASTEXITCODE to 0 after the best-effort embed so it can
never affect the task result. Observed on build 14701124 (PR #36561, catalyst);
build 14701123 (PR #36541, gate passed) posted a review afterward and was
unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 19, 2026
@MauiBot

MauiBot commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Merge Conflict Detected — This PR has merge conflicts with its target branch. Please rebase onto the target branch and resolve the conflicts.

@MauiBot

MauiBot commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Warning

🔍 Automated review could not complete

A stage of the reviewer pipeline could not finish, so no review summary was produced for this run — most often the review stage itself hanging, or the run being canceled by its overall timeout. This is almost always a transient infrastructure issue on the CI agent, not a problem with your PR. (Note: a test-verification gate timeout no longer lands here — it now posts a normal AI Summary whose Gate section explains the timeout.)

Please re-comment /review to retry on a fresh agent.

🔍 Automated message from the .NET MAUI Copilot reviewer pipeline · build log

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 20, 2026
@Shalini-Ashokan

Copy link
Copy Markdown
Contributor Author

Could you please resolve conflicts?

I have resolved the conflights

@kubaflo
kubaflo merged commit 13533be into dotnet:inflight/current Jul 20, 2026
6 of 38 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR10 milestone Jul 20, 2026
kubaflo pushed a commit that referenced this pull request Jul 22, 2026
…n Windows and iOS/macOS (#36561)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->


### Issue Details
Grouped  CollectionView  with  GridItemsLayout  (Span > 1,
 VerticalItemSpacing  set) renders inconsistently across platforms. On
Windows, the first item in the first group renders smaller than others.
On iOS/macOS, no spacing appears between the group header and the first
row of items.

### Root Cause
**Windows**: The generated item container style didn't stretch content
vertically, so the first grid cell (whose row height differs due to the
header) collapsed to its content size instead of filling the row.

**iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent)
never set  InterSectionSpacing / ContentInsets  for the header-to-item
gap — that logic only existed in the list layout path, not the grid
layout path.


### Description of Change
**Windows**: Added  VerticalContentAlignmentProperty =
VerticalAlignment.Stretch  to the item container style in
 StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch
uniformly to fill their row instead of the first item sizing to content.

**iOS/macOS**: Extracted the header/footer boundary-spacing logic into a
shared  ApplyHeaderFooterBoundarySpacing  helper in  LayoutFactory2.cs ,
and invoked it from the grid layout as well (previously only the list
layout applied it). Also set  layoutConfiguration.InterSectionSpacing 
using the main-axis spacing so consistent gaps appear between the header
and first row across grouped sections.

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #36545 

### Output  ScreenShot
Windows
|Before|After|
|--|--|
|<img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8"
/> | <img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81"
/> |

iOS
|Before|After|
|--|--|
|<img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b"
/> | <img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92"
/> |
kubaflo pushed a commit that referenced this pull request Jul 28, 2026
…n Windows and iOS/macOS (#36561)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->


### Issue Details
Grouped  CollectionView  with  GridItemsLayout  (Span > 1,
 VerticalItemSpacing  set) renders inconsistently across platforms. On
Windows, the first item in the first group renders smaller than others.
On iOS/macOS, no spacing appears between the group header and the first
row of items.

### Root Cause
**Windows**: The generated item container style didn't stretch content
vertically, so the first grid cell (whose row height differs due to the
header) collapsed to its content size instead of filling the row.

**iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent)
never set  InterSectionSpacing / ContentInsets  for the header-to-item
gap — that logic only existed in the list layout path, not the grid
layout path.


### Description of Change
**Windows**: Added  VerticalContentAlignmentProperty =
VerticalAlignment.Stretch  to the item container style in
 StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch
uniformly to fill their row instead of the first item sizing to content.

**iOS/macOS**: Extracted the header/footer boundary-spacing logic into a
shared  ApplyHeaderFooterBoundarySpacing  helper in  LayoutFactory2.cs ,
and invoked it from the grid layout as well (previously only the list
layout applied it). Also set  layoutConfiguration.InterSectionSpacing 
using the main-axis spacing so consistent gaps appear between the header
and first row across grouped sections.

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #36545 

### Output  ScreenShot
Windows
|Before|After|
|--|--|
|<img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8"
/> | <img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81"
/> |

iOS
|Before|After|
|--|--|
|<img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b"
/> | <img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92"
/> |
kubaflo pushed a commit that referenced this pull request Jul 29, 2026
…n Windows and iOS/macOS (#36561)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->


### Issue Details
Grouped  CollectionView  with  GridItemsLayout  (Span > 1,
 VerticalItemSpacing  set) renders inconsistently across platforms. On
Windows, the first item in the first group renders smaller than others.
On iOS/macOS, no spacing appears between the group header and the first
row of items.

### Root Cause
**Windows**: The generated item container style didn't stretch content
vertically, so the first grid cell (whose row height differs due to the
header) collapsed to its content size instead of filling the row.

**iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent)
never set  InterSectionSpacing / ContentInsets  for the header-to-item
gap — that logic only existed in the list layout path, not the grid
layout path.


### Description of Change
**Windows**: Added  VerticalContentAlignmentProperty =
VerticalAlignment.Stretch  to the item container style in
 StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch
uniformly to fill their row instead of the first item sizing to content.

**iOS/macOS**: Extracted the header/footer boundary-spacing logic into a
shared  ApplyHeaderFooterBoundarySpacing  helper in  LayoutFactory2.cs ,
and invoked it from the grid layout as well (previously only the list
layout applied it). Also set  layoutConfiguration.InterSectionSpacing 
using the main-axis spacing so consistent gaps appear between the header
and first row across grouped sections.

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #36545 

### Output  ScreenShot
Windows
|Before|After|
|--|--|
|<img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8"
/> | <img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81"
/> |

iOS
|Before|After|
|--|--|
|<img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b"
/> | <img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92"
/> |
kubaflo pushed a commit that referenced this pull request Aug 7, 2026
…n Windows and iOS/macOS (#36561)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->


### Issue Details
Grouped  CollectionView  with  GridItemsLayout  (Span > 1,
 VerticalItemSpacing  set) renders inconsistently across platforms. On
Windows, the first item in the first group renders smaller than others.
On iOS/macOS, no spacing appears between the group header and the first
row of items.

### Root Cause
**Windows**: The generated item container style didn't stretch content
vertically, so the first grid cell (whose row height differs due to the
header) collapsed to its content size instead of filling the row.

**iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent)
never set  InterSectionSpacing / ContentInsets  for the header-to-item
gap — that logic only existed in the list layout path, not the grid
layout path.


### Description of Change
**Windows**: Added  VerticalContentAlignmentProperty =
VerticalAlignment.Stretch  to the item container style in
 StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch
uniformly to fill their row instead of the first item sizing to content.

**iOS/macOS**: Extracted the header/footer boundary-spacing logic into a
shared  ApplyHeaderFooterBoundarySpacing  helper in  LayoutFactory2.cs ,
and invoked it from the grid layout as well (previously only the list
layout applied it). Also set  layoutConfiguration.InterSectionSpacing 
using the main-axis spacing so consistent gaps appear between the header
and first row across grouped sections.

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #36545 

### Output  ScreenShot
Windows
|Before|After|
|--|--|
|<img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8"
/> | <img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81"
/> |

iOS
|Before|After|
|--|--|
|<img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b"
/> | <img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92"
/> |
kubaflo pushed a commit that referenced this pull request Aug 12, 2026
…n Windows and iOS/macOS (#36561)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->


### Issue Details
Grouped  CollectionView  with  GridItemsLayout  (Span > 1,
 VerticalItemSpacing  set) renders inconsistently across platforms. On
Windows, the first item in the first group renders smaller than others.
On iOS/macOS, no spacing appears between the group header and the first
row of items.

### Root Cause
**Windows**: The generated item container style didn't stretch content
vertically, so the first grid cell (whose row height differs due to the
header) collapsed to its content size instead of filling the row.

**iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent)
never set  InterSectionSpacing / ContentInsets  for the header-to-item
gap — that logic only existed in the list layout path, not the grid
layout path.


### Description of Change
**Windows**: Added  VerticalContentAlignmentProperty =
VerticalAlignment.Stretch  to the item container style in
 StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch
uniformly to fill their row instead of the first item sizing to content.

**iOS/macOS**: Extracted the header/footer boundary-spacing logic into a
shared  ApplyHeaderFooterBoundarySpacing  helper in  LayoutFactory2.cs ,
and invoked it from the grid layout as well (previously only the list
layout applied it). Also set  layoutConfiguration.InterSectionSpacing 
using the main-axis spacing so consistent gaps appear between the header
and first row across grouped sections.

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #36545 

### Output  ScreenShot
Windows
|Before|After|
|--|--|
|<img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8"
/> | <img width="1010" height="729" alt="image"
src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81"
/> |

iOS
|Before|After|
|--|--|
|<img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b"
/> | <img width="752" height="1492" alt="image"
src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92"
/> |
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 s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[windows, iOS & macOS]Grouped CollectionView with GridItemsLayout renders inconsistent layout across platforms

5 participants