question

ShobikaPalani-2398 avatar image
7 Votes"
ShobikaPalani-2398 asked ·

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

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:

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

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

VS2017 - NetFramework-4.6.1

9853-vs2017-461-framework.png

VS2019 - NETFramework-4.7.2

9855-vs2019-472-framework.png

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

Regards,
Shobika


windows-wpf
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Why did you set MaxWidth=0 not MinWidth for the column? Could you show me the whole xaml code for me?

0 Votes 0 · ·

0 Answers