ColumnSpan in Grid is not working properly when MaxWidth is 0 in VisualStudio 2019 (Version - 16.4.5)

Shobika Palani 36 Reputation points

In my project created in VisualStudio 2019 with version 16.4.5, I have some columndefintions in grid and also uses columnspanning. But when I set maxwidth as 0 for some definition, the columndefinitions are not spanned to full width properly.

Code Snippet:

            <ColumnDefinition MaxWidth="0"/>    
            <ColumnDefinition Width="*"/>  
        <Border Background="Red" Grid.ColumnSpan="2"/>  
        <TextBlock Grid.Column="1" Text="Testing"/>  

The same code above is working different in different frameworks. Please refer to the below ScreenShots

VS2017 - NetFramework-4.6.1


VS2019 - NETFramework-4.7.2


Please look into this and provide your suggestion to fix this issue?


Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,369 questions
{count} votes