This project has moved and is read-only. For the latest updates, please go here.

DataGrid - Add little button for filtrer in column Header

Nov 25, 2013 at 3:56 PM

I work with the lasted version of DataGrid.

I would like add a function filter and I want add a control in my column header.

I want to keep the header default style and simply add a small button to right.

I writted this code
<Style TargetType="{x:Type xcdg:ColumnManagerCell}">
                                                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                                    <Setter Property="HorizontalAlignment" Value="Center"/>                                                    
                                                    <Setter Property="Template">
                                                            <ControlTemplate TargetType="{x:Type xcdg:ColumnManagerCell}">
                                                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                                                        <ColumnDefinition Width="Auto"></ColumnDefinition>                                                                        
                                                                    <ContentPresenter Grid.Column="0"
                                                                                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                                      ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                                                      Style="{TemplateBinding Style}">                                                                       
                                                                    <Button Grid.Column="1" Background="Transparent" ToolTip="Filtrer...">
                                                                            <Image Source="Resources\Ajouter.png" Width="16" Height="16"></Image>
                                                                    <Button Grid.Column="1" Content="..."></Button>
Thank you for your help.