We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

FilterToggleButton

Thread ID:

Created:

Updated:

Platform:

Replies:

116491 Jun 2,2014 11:56 AM UTC Jun 5,2014 01:20 PM UTC WPF 1
loading
Tags: SfDataGrid
Juraj Tomana
Asked On June 2, 2014 11:56 AM UTC

Hi.

Please advice me, how to achieve that, when I set some column's filter, FilterToggleButton changes its foreground color.

I've tried in my GridHeaderCellControl.Template to change:

<syncfusion:FilterToggleButton x:Name="PART_FilterToggleButton" VerticalAlignment="Top"
                      HorizontalAlignment="Center" 
                Foreground="{Binding FilterPredicates, Converter={StaticResource filterButtonForegroundConverter}}" 
SnapsToDevicePixels="True" Margin="0,2,0,0"
                      Visibility="{TemplateBinding FilterIconVisiblity}" Width="15" Height="13">
                  </syncfusion:FilterToggleButton>


It has changed the button's foreground, but when I've changed the columns filter, it doesn't catch the change of FilterPredicates collection.

Thanks.

Regards,
Juraj

Saravanan C [Syncfusion]
Replied On June 5, 2014 01:20 PM UTC

Hi Juraj,

 

Thank you for contacting Syncfusion Support.

 

We have analyzed your requirement “to change the color of the FilterToggleButton while filtering ”. You can achieve your requirement by editing the control template of the FilterToggleButton and applying color using ColorAnimation. Please refer the following code sample:

 

Code Sample[XAML]:

<VisualState x:Name="Filtered">

                                        <Storyboard>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_FilterToggleButtonIndicator" Storyboard.TargetProperty="Data">

                                                <DiscreteObjectKeyFrame KeyTime="0">

                                                    <DiscreteObjectKeyFrame.Value>

                                                        <Geometry>M2.1299944,9.9798575L55.945994,9.9798575 35.197562,34.081179 35.197562,62.672859 23.428433,55.942383 23.428433,33.52121z M1.3001332,0L56.635813,0C57.355887,0,57.935946,0.5891428,57.935946,1.3080959L57.935946,2.8258877C57.935946,3.5448422,57.355887,4.133985,56.635813,4.133985L1.3001332,4.133985C0.58005941,4.133985,-2.3841858E-07,3.5448422,0,2.8258877L0,1.3080959C-2.3841858E-07,0.5891428,0.58005941,0,1.3001332,0z</Geometry>

                                                    </DiscreteObjectKeyFrame.Value>

                                                </DiscreteObjectKeyFrame>

                                            </ObjectAnimationUsingKeyFrames>

 

                                            <ColorAnimation Storyboard.TargetName="PathFillColor" Storyboard.TargetProperty="Color"  To="Red" Duration="0:0:0:1"/>

 

                                        </Storyboard>

</VisualState>

 

We have prepared a sample based on your requirement. Please find the sample in the following location:

Sample:  http://www.syncfusion.com/downloads/support/directtrac/125862/HeaderColorChange970432867.zip

 

Please let us know if you have any queries.

 

Thanks,

Saravanan C


Attachment: HeaderColorChange_7f6ff5cb.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;