DeveloperExpressWPFコントロールを評価しています。BackgroundColor
DevExpressの現在の行のを変更するにはどうすればよいGridControl
ですか?
質問する
2946 次
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 に答える