DataGridTemplateColumn: Want popup on mouseover

Jul 10, 2009 at 10:38 PM

My users will never remember to right click on the datagridcolumn header to get to the context menu. I would like to have a popup displayed when they mouseover the column header. I tried the following...I would welcome any help!!! Thanks

<tk:DataGridTemplateColumn  
                    Header="Name" 
                    CellTemplate="{StaticResource NameTextCellTemplate}"
                    CellEditingTemplate="{StaticResource NameTextCellTemplate}" >
                        <tk:DataGridTemplateColumn.HeaderStyle>
                            <Style TargetType="tk:DataGridColumnHeader">
                                <Setter Property="ContentTemplate">
                                    <Setter.Value>
                                        <DataTemplate>
                                            <Popup>
                                                <Border 
                                                    BorderBrush="Black" 
                                                    BorderThickness="1">
                                                    <Grid>
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="22"   />                                                           
                                                        </Grid.RowDefinitions>
                                                        <Grid.ColumnDefinitions></Grid.ColumnDefinitions>
                                                        <CheckBox 
                                                            Grid.Row="0"    
                                                            IsChecked="{Binding Source={x:Static CommonControls:CheckpointsGridViewApplicationState.Instance}, 
                                                                                  Path=ColumnVisibility, 
                                                                                  Mode=TwoWay}"
                                                            Content="Name Visibility"/>                                           
                                                    </Grid>
                                                </Border>
                                            </Popup> 
                                        </DataTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </tk:DataGridTemplateColumn.HeaderStyle>
                    </tk:DataGridTemplateColumn>     
Then I apply the style. I get the column header changing colors, but no popup.
 <Style x:Key="RouteColumnHeaderStyle" TargetType="{x:Type tk:DataGridColumnHeader}">
     <Style.Triggers>  
            <Trigger Property="IsMouseOver" Value="true" >
                <Setter Property="Popup.IsOpen" Value="true"/>
                <Setter Property="Background" Value="Red" />
                <Setter Property="BorderBrush" Value="Black" />
            </Trigger>    
        </Style.Triggers>
    </Style>