How to set style for selectedRow in datagrid?

Oct 2, 2008 at 10:25 AM
How can I set style for selectedRow using Xaml (which mean I define this style in XAML file) eg:
[Code]
<DataGrid  Style={StaticResouce GridStyle}>
....
</DataGrid>
<Style x:Key="GridStyle">
 Define the style for selectedRow here
</Style>
[/Code]

Coordinator
Oct 3, 2008 at 1:08 PM
You can set properties on the selected row by using a style trigger in a row style.

<

 

Style TargetType="{x:Type dg:DataGridRow}">
    <Style.Triggers>
        <Trigger Property="IsSelected" Value="True">
            <Setter Property="some property" Value="some value" />
        </Trigger>
    </Style.Triggers>
</Style>

 

Oct 12, 2008 at 4:37 AM
It works,
Thanks