0

DeveloperExpressWPFコントロールを評価しています。BackgroundColorDevExpressの現在の行のを変更するにはどうすればよいGridControlですか?

4

2 に答える 2

1

私はマークに同意します。サードパーティのコントロールの解決策を見つけるのに一般的に最適な場所は、ドキュメントとフォーラムです。これがdevexpressフォーラム投稿からのコードスニペットです-

<Window x:Class="DXGrid_ChangeRowAppearance.Window1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
        Title="Window1" Height="300" Width="505">
    <Window.Resources>
        <Style x:Key="SelectedRowStyle" TargetType="{x:Type dxg:GridRowContent}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsSelected}" Value="True">
                    <Setter Property="Background" Value="Gray" />
                    <Setter Property="Foreground" Value="White" />
                </DataTrigger>
                <Trigger Property="dxg:GridViewBase.IsFocusedRow" Value="True">
                    <Setter Property="Background" Value="Red" />
                    <Setter Property="Foreground" Value="White" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Grid>
        <dxg:GridControl x:Name="grid" AutoPopulateColumns="True">
            <dxg:GridControl.View>
                <dxg:TableView AutoWidth="True" MultiSelectMode="Row" 
                     ShowGroupPanel="False" 
                     AllowGrouping="False" 
                     RowStyle="{StaticResource SelectedRowStyle}">
                </dxg:TableView>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>

http://www.devexpress.com/Support/Center/p/E2066.aspx

Property="dxg:GridViewBase.IsFocusedRow"ここで重要なのはトリガーで使うことだと思います。

于 2012-06-08T19:00:39.480 に答える
0

たぶん、この前の投稿はあなたを助けるでしょう。

さらに、ここでdevexpressのオンラインドキュメントを確認することを強くお勧めします。

DevExpressWebサイトで公式フォーラムを検索することもできます。同じ問題に直面している人はたくさんいます。

それが少し役に立ったことを願っています。

于 2012-06-08T17:48:56.067 に答える