[英]How to show complete Expander Grid in wpf?
I used expander to show few items in Devexpress DockPanel, but as i clicked it, it showed half part of a grid. 我使用扩展器在Devexpress DockPanel中显示几个项目,但是当我点击它时,它显示了网格的一半部分。 How to show complete grid of expander while moving panle2 below to show complete Expander-Grid? 如何在移动下面的panle2时显示完整的扩展器网格以显示完整的Expander-Grid? Here code and screen shot is: 这里的代码和屏幕截图是:
<Grid>
<dxdo:DockLayoutManager>
<dxdo:LayoutGroup Caption="LayoutRoot" Orientation="Vertical">
<dxdo:LayoutPanel Caption="Panel1" ItemWidth="0.96*" ItemHeight="0.39*">
<Grid>
<Label Content="Label" HorizontalAlignment="Left" Height="0" Margin="286,28,0,0" VerticalAlignment="Top" Width="15"/>
<Expander Header="Expander" HorizontalAlignment="Left" Margin="2,0,0,0" VerticalAlignment="Top">
<Grid Background="#FFE5E5E5" Width="756" Height="59">
<Label Content="Label" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="55"/>
<ComboBox HorizontalAlignment="Left" Height="13" Margin="99,23,0,0" VerticalAlignment="Top" Width="586"/>
</Grid>
</Expander>
</Grid>
</dxdo:LayoutPanel>
<dxdo:LayoutPanel Caption="Panel2" ItemWidth="1.04*" ItemHeight="1.61*"/>
</dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
Start with the basics 从基础开始
<Window x:Class="ExpanderSimple.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Expander Grid.Row="0" Name="myExpander" Background="Tan" BorderBrush="Red" BorderThickness="2"
HorizontalAlignment="Left" VerticalAlignment="Bottom" Header="My Expander"
ExpandDirection="Up" IsExpanded="False" Width="auto" >
<TextBlock TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua
</TextBlock>
</Expander>
<Border Grid.Row="2" BorderBrush="Blue" BorderThickness="5" Margin="2"/>
</Grid>
</Window>
You should remove ItemHeight="0.39*"
from your Panel1. 您应该从ItemHeight="0.39*"
删除ItemHeight="0.39*"
。 You are constraining panel height. 您正在约束面板高度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.