Grid panel strange behaviour
Posted: 20 Nov 2015, 16:49
Hi
I have a problem with the Grid panel. I don't know if it is a bug or it is supposed to be this way.
The problem is that the TextBlock streches over the size of the grid cell.
Here is the code
and this is the result
https://www.dropbox.com/s/s7o5bxh0qxvtc ... g.png?dl=0
I have a problem with the Grid panel. I don't know if it is a bug or it is supposed to be this way.
The problem is that the TextBlock streches over the size of the grid cell.
Here is the code
Code: Select all
<ListBox Grid.Column="1" DataContext="{StaticResource filesViewModel}" ItemsSource="{Binding Scenes}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="30" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Name}" TextAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding Path=Players, Converter={StaticResource PlayersToTextConverter}}" TextAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding Path=Fitness, Converter={StaticResource IntegerToStarSxmbolConverter}}" TextAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding Path=Technics, Converter={StaticResource IntegerToStarSxmbolConverter}}" TextAlignment="Center"/>
<TextBlock Grid.Column="4" Text="{Binding Path=Tactics, Converter={StaticResource IntegerToStarSxmbolConverter}}" TextAlignment="Center" Background="Green"/>
<TextBlock Grid.Column="5" Text="{Binding Path=Fun, Converter={StaticResource IntegerToStarSxmbolConverter}}" TextAlignment="Center" Background="Red"/>
<TextBlock Grid.Column="6" Text="{Binding Name}" Background="Blue" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
https://www.dropbox.com/s/s7o5bxh0qxvtc ... g.png?dl=0