<Style x:Key="DataGridRowStyleDark" TargetType="{x:Type DataGridRow}"><Setter Property="CacheMode"><Setter.Value><BitmapCache EnableClearType="True" RenderAtScale="4"></BitmapCache></Setter.Value></Setter><Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/><Setter Property="SnapsToDevicePixels" Value="true"/><!--<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/><Setter Property="ValidationErrorTemplate"><Setter.Value><ControlTemplate><TextBlock Foreground="Red" Margin="2,0,0,0" Text="!" VerticalAlignment="Center"/></ControlTemplate></Setter.Value></Setter> --><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type DataGridRow}"><Border x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True" IsEnabled="{TemplateBinding IsEnabled}"><SelectiveScrollingGrid IsEnabled="{TemplateBinding IsEnabled}"><SelectiveScrollingGrid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/></SelectiveScrollingGrid.ColumnDefinitions><SelectiveScrollingGrid.RowDefinitions><RowDefinition Height="*"/><RowDefinition Height="Auto"/></SelectiveScrollingGrid.RowDefinitions><DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsEnabled="{TemplateBinding IsEnabled}"/><DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Visibility="{TemplateBinding DetailsVisibility}" IsEnabled="{TemplateBinding IsEnabled}"/><!--<DataGridRowHeader Grid.RowSpan="2" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Background="#00000000"/>--></SelectiveScrollingGrid></Border><ControlTemplate.Triggers><Trigger Property="IsEnabled" Value="False"><Setter Property="Opacity" TargetName="DGR_Border" Value="{DynamicResource DoubleOpacity}"/></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter><Style.Triggers><Trigger Property="IsNewItem" Value="True"><Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/></Trigger></Style.Triggers></Style>
I have created a different style for DataGridRow, but when I set DataGridRow IsEnabled property to False, the row continue to be enabled. I can click it, and it does not have any clue that is not enabled.
What's wrong?
Take a look at WPF FlashMessage
About.me