Articles in this section
Category / Section

How to customize the filter and advanced filter appearance of WPF DataGrid (SfDataGrid) ?

1 min read

You can customize the appearance of GridFilterControl and AdvancedFilterControl by overriding its ControlTemplate in WPF DataGrid (SfDataGrid).

<!--Filter Style-->
<Style x:Key="ButtonFocusVisual">
    <Setter Property="Control.Template">
        <Setter.Value>
            <ControlTemplate>
                <Rectangle SnapsToDevicePixels="true"
                            Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                            StrokeDashArray="1 2"
                            StrokeThickness="1" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
<!--Advanced Filter Style-->
<Style x:Key="ComboBoxFocusVisual">
    <Setter Property="Control.Template">
        <Setter.Value>
            <ControlTemplate>
                <Rectangle Margin="4,4,19,4"
                            SnapsToDevicePixels="true"
                            Stroke="Black"
                            StrokeDashArray="1 2"
                            StrokeThickness="1" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Customized filtercontrol and advancedfiltercontrol.

View WPF DataGrid Filter Demo in GitHub.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied