Materialdesigninxamltoolkit: Remove border around the selected cell in DataGrid

Created on 21 Jun 2019  路  1Comment  路  Source: MaterialDesignInXAML/MaterialDesignInXamlToolkit

Is it possible to remove the black border around the selected cell in DataGrid control ?

image

Most helpful comment

I believe the only solution is to override the DataCell Style, as the border is hardcoded in the template. My approach has always been using this style in DataGrid > CellStyle

<Style
    BasedOn="{StaticResource MaterialDesignDataGridCell}"
    TargetType="{x:Type DataGridCell}">
    <Style.Triggers>
        <Trigger Property="IsKeyboardFocusWithin" Value="True">
            <Setter Property="BorderBrush" Value="Transparent" />
        </Trigger>
    </Style.Triggers>
</Style>

Hope this helps.

>All comments

I believe the only solution is to override the DataCell Style, as the border is hardcoded in the template. My approach has always been using this style in DataGrid > CellStyle

<Style
    BasedOn="{StaticResource MaterialDesignDataGridCell}"
    TargetType="{x:Type DataGridCell}">
    <Style.Triggers>
        <Trigger Property="IsKeyboardFocusWithin" Value="True">
            <Setter Property="BorderBrush" Value="Transparent" />
        </Trigger>
    </Style.Triggers>
</Style>

Hope this helps.

Was this page helpful?
0 / 5 - 0 ratings