2,854 questions
For example, replace <RowDefinition Height="90"/>
with <RowDefinition Height="*"/>
.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have this XAML:
<Window x:Class="MultiWindows.TreeViewControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MultiWindows"
mc:Ignorable="d"
Title="TreeViewControl" Height="450" Width="800">
<Grid ShowGridLines="True" Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="29"/>
<RowDefinition Height="29"/>
<RowDefinition Height="90"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="470" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<TextBlock Text="hola" Name="textBlock1" Grid.Column="1" Grid.Row="1" Margin="6,6,0,0"/>
<TreeView x:Name="treeViewCountry" Width="180" Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" >
<TreeViewItem Header="United States" >
<TreeViewItem Header="New York" />
<TreeViewItem Header="Los Angeles" />
<TreeViewItem Header="Chicago" />
</TreeViewItem>
<TreeViewItem Header="France" x:Name="french" >
<TreeViewItem Header="Paris" />
<TreeViewItem Header="Marseille" />
<TreeViewItem Header="Lyon" />
<TreeViewItem Header="Tolouse" />
</TreeViewItem>
</TreeView>
<Grid ShowGridLines="True" Name="gridinternal" Height="377" Grid.Row="2" Grid.Column="1" Grid.RowSpan="2" Margin="2,3,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="29"/>
<RowDefinition Height="29"/>
<RowDefinition Height="29"/>
<RowDefinition Height="29"/>
<RowDefinition Height="29"/>
<RowDefinition Height="29"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition Width="240" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<TextBlock Text="First Name" Grid.Row="1" TextAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Last Name" Grid.Row="2" TextAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Email" Grid.Row="3" Grid.Column="0" x:Name="email"/>
</Grid>
</Grid>
</Window>
The TextBlock with text "Email" is not displayed unless I add another RowDefinition to the outer grid!! but it is supposed to be in row 3 of the inner grid! What's hapenning?
Also I want the TreeView to cover the whole column 0 row 2 of the outer grid, how can I do that?
Please I am learning XAML
For example, replace <RowDefinition Height="90"/>
with <RowDefinition Height="*"/>
.