フィルタリング時に表示されるドロップダウンウィンドウのサイズを変更するには?

文書番号 : 39499     文書種別 : 使用方法     登録日 : 2016/07/13     最終更新日 : 2016/07/13
文書を印刷する
対象製品
SPREAD for WPF 1.0J
詳細
フィルタリングを有効にし、フィルタボタンを押下するとフィルタ情報を表示するドロップダウンリストおよび[OK]、[キャンセル]ボタンを持つドロップダウンウィンドウが表示されます。このドロップダウンウィンドウの幅や高さなどのサイズを変更するには、次のようなXAMLコードを使用してAutoFilterListBoxクラスのWidthおよびHeightプロパティを設定します。

◎サンプルコード(xaml)
<Window.Resources>
    <Style TargetType="sg:AutoFilterEditor">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="sg:AutoFilterEditor">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="5"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <sg:AutoFilterListBox x:Name="ItemsPresenter" 
                                           Height="250" 
                                           Width="230" 
                                           DisplayMemberPath="DisplayText">
                        </sg:AutoFilterListBox>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2">
                            <Button Name="OKButton" Content="OK" MinWidth="60" Margin="2"></Button>
                            <Button Name="CancelButton" Content="Cancel" MinWidth="60" Margin="4,2,2,2"></Button>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>

関連情報