Hi Kivanc Yilmaz,
Your requirement to change the visibility of the filter toggle button in SfDataGrid can be achieved by customizing GridHeaderCellControl in the HeaderStyle
property in GridColumn. Refer to the below code snippet,
<!--Here customize the GridHeaderCellControl to handle the
filtericonvisibility for specific column-->
<Style x:Key="GridHeaderCellControlStyle" TargetType="{x:Type syncfusion:GridHeaderCellControl}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="BorderThickness" Value="0,0,1,1" />
………………………………………
………………………………………
…………………………………….
<!--Here customize the Visibility based on your
scenario-->
<syncfusion:FilterToggleButton x:Name="PART_FilterToggleButton"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
SnapsToDevicePixels="True"
Visibility="Collapsed" />
</Grid>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Here assign the customized HeaderStyle for specific column
to handle the filtericonvisibility that column-->
<syncfusion:GridTextColumn MappingName="CustomerName" HeaderStyle="{StaticResource GridHeaderCellControlStyle}" HeaderText="Customer
Name" />
|
UG Link: https://help.syncfusion.com/wpf/datagrid/styles-and-templates#styling-header-cell
Find the sample in the attachment.
Regards,
Vijayarasan S
If this post is helpful, please consider Accepting it as the
solution so that other members can locate it more quickly.
Attachment:
Sample_41e8fd80.zip