Welcome to the Xceed Community | Help
Community Search  
More Search Options

Change filter button style and behavior on Xceed datagrid

Sort Posts: Previous Next
  •  06-12-2012, 9:07 PM Post no. 32242

    Change filter button style and behavior on Xceed datagrid

    Hi,

    We would like to display a filter button next to the down arrow, which is for filtering data, and would like to change the style when mouseover/mouseout. Is there a way to do it?

    Thanks!

  •  06-12-2012, 10:54 PM Post no. 32244 in reply to 32242

    Re: Change filter button style and behavior on Xceed datagrid

    Hi Olivia,

    This can be done. However, this should require an extensive amount of XAML.  By default there is a filter icon that you will click on when the mouse hovers about the ColumnManagerCell. Will your Filter button do the same thing? In any case, you will need to open up the template for the ColumnManagerCell. You can find the default templates and styles installed on your machine:

    C:\Program Files (x86)\Xceed\Xceed DataGrid for WPF Professional Edition v4.3\Themes\Aero

    You can open up the TableflowView if you are using this view.

    Do a search (Ctrl + F) for "TEMPLATE: ColumnManagerCell". From here, you have the template for the ColumnManagerCell. I would recommend copy/pasting the xaml in a resource dictionary file in your application. Then you can play around with the XAML and change the template to your liking.


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  06-19-2012, 1:41 PM Post no. 32275 in reply to 32244

    Re: Change filter button style and behavior on Xceed datagrid

    Hi Marc,

    I made most of the part working based on your suggestion. One of the problems though is the background of the filter button is white, although in the xmal, it is set to transparent (and it is the one from the original source). Here is the xaml code I have. The image I added is based on the DataTemplate of  "autoFilterGlyph" with the Path.Fill section removed.

        <Style TargetType="{x:Type XceedDataGrid:ColumnManagerCell}">
            <Setter Property="ToolTip"
                    Value="{Binding Path=ParentColumn.Title, RelativeSource={RelativeSource Self}}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="XceedDataGrid:ColumnManagerCell">
                    ... <code from TableflowView.Aero.normalcolor.xaml except for the images>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    Thanks!

  •  06-22-2012, 2:04 AM Post no. 32290 in reply to 32275

    Re: Change filter button style and behavior on Xceed datagrid

    I have tried to just copy the template without changing anything and the problem still exists. Any suggestions?

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.