dotnet / dotnet/wpf

Grid isn't calculating row height correctly in some cases when RowSpan is used

Open
#7,299 2 comments 0 reactions 1 assignee Claimed by @Kuldeep-MS View on GitHub
area-Grid Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: All
* Windows version: 11
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

The following XAML:
```xaml










```

should render two rows, each with height of 100 because each element has a height of 100, with exception of the one that spans 2 rows, which has a height of 200.

However, the result is the following:
![image](https://user-images.githubusercontent.com/2470527/202486566-32eea7c6-0b6d-4766-b760-66a376b60878.png)

The second row is exactly 1.5 times the height it should be.

**Expected behavior:**
![image](https://user-images.githubusercontent.com/2470527/202486980-e05535ca-4646-4463-9bff-eea7485c3e10.png)

If we insert the following:
```xaml

```

Then the grid is rendered as expected.

An interesting observation is that if we set explicit width for the first column, which in my example has 1* width, then the problem disappears.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.