Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The actual template for the row is a bit more complicated than this. See the style below - it's pretty much the basic style but I've added some of your design and left triggers for <code>IsMouseOver</code> and <code>IsSelected</code> (feel free to remove them).</p> <pre><code>&lt;Style TargetType="{x:Type DataGridRow}"&gt; &lt;Setter Property="Background" Value="Transparent" /&gt; &lt;Setter Property="BorderBrush" Value="Red" /&gt; &lt;Setter Property="BorderThickness" Value="2" /&gt; &lt;Setter Property="SnapsToDevicePixels" Value="true" /&gt; &lt;Setter Property="Validation.ErrorTemplate" Value="{x:Null}" /&gt; &lt;Setter Property="ValidationErrorTemplate"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate&gt; &lt;TextBlock Foreground="Red" Margin="2,0,0,0" Text="!" VerticalAlignment="Center" /&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type DataGridRow}"&gt; &lt;Border x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True" CornerRadius="8,8,8,8"&gt; &lt;SelectiveScrollingGrid&gt; &lt;SelectiveScrollingGrid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/SelectiveScrollingGrid.ColumnDefinitions&gt; &lt;SelectiveScrollingGrid.RowDefinitions&gt; &lt;RowDefinition Height="*" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;/SelectiveScrollingGrid.RowDefinitions&gt; &lt;DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /&gt; &lt;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}" /&gt; &lt;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}}}" /&gt; &lt;/SelectiveScrollingGrid&gt; &lt;/Border&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter TargetName="DGR_Border" Property="Background" Value="LightGray" /&gt; &lt;/Trigger&gt; &lt;Trigger Property="IsSelected" Value="True"&gt; &lt;Setter TargetName="DGR_Border" Property="Background" Value="Gray" /&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>Oh, and btw, you have a key for the style but you don't reference it at any point - so the row uses it's default style. To use your style or the one provided above, don't give a key to the resource.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload