Expand a control to fill grid column
I'm having a problem getting a panelbar to expand it's width to match the Grid column it occupies. The offending code is the second appearance of a panelbar with an item header named "Operators". I can set the width explicitly to fill the column, but that would only show correctly for my specific resolution and is not the solution I'm looking for. I would just like it to stretch on it's own. Code snippet below.
<telerik:RadTabControl telerik:StyleManager.Theme="Windows7" Grid.Column="2">
<telerik:RadTabItem Header="Add/Edit">
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto">&l开发者_运维问答t;/ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock FontSize="20" Grid.Row="0">Organization Name Here:</TextBlock>
<my1:QueryBuilder Height="Auto" Width="Auto" Grid.Row="1"></my1:QueryBuilder>
<telerik:RadPanelBar ExpandMode="Single" Grid.Column="1" Grid.Row="1" Width="Auto"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<telerik:RadPanelBarItem Header="Operators"></telerik:RadPanelBarItem>
</telerik:RadPanelBar>
</Grid>
</telerik:RadTabItem>
</telerik:RadTabControl>
You Second ColumnDefinition
should have Width
of "*" not "Auto" as you have currently.
精彩评论