簡體   English   中英

如何在wpf中顯示完整的Expander Grid?

[英]How to show complete Expander Grid in wpf?

我使用擴展器在Devexpress DockPanel中顯示幾個項目,但是當我點擊它時,它顯示了網格的一半部分。 如何在移動下面的panle2時顯示完整的擴展器網格以顯示完整的Expander-Grid? 這里的代碼和屏幕截圖是:

它說我必須有10個聲譽來發布圖像所以這里是[link] [1]

<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>

從基礎開始

<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>

您應該從ItemHeight="0.39*"刪除ItemHeight="0.39*" 您正在約束面板高度。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM