This is a migrated thread and some comments may be shown as answers.

How to put dropdown on ToolWindow header ?

5 Answers 154 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nitin
Top achievements
Rank 1
Nitin asked on 23 Nov 2010, 01:19 PM
Hi,

I want to display the dropdown on ToolWindow header same as it is displayed on PaneHeader. I tried to do so using control template, but the button gets disabled. How can I do this ?

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 24 Nov 2010, 05:07 PM
Hi Nitin,

Please, refer to our online documentation:


Also, you send us a sample project that reproduces the problem it would be very helpful in further investigating the problem. 


Best wishes,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Nitin
Top achievements
Rank 1
answered on 25 Nov 2010, 06:14 AM
George,

You didn't understand my problem. I want to display the dropdown on the Titlebar/Header of the ToolWindow. I tried to set the style and put a dropdown inside the header, but when ToolWindow is displayed all the controls in the header get disabled.

Can you explain me why all the controls get disabled when put in ToolWindow header.

The link you posted, couldn't solve my problem. In the snapshot, PaneHeader of RadPane is visible when it is hosted in a ToolWindow, but at runtime it is never shown in a ToolWindow, you can check it in the WPF demo.

Please have a look at the snapshot, you will get what I want.
0
George
Telerik team
answered on 30 Nov 2010, 04:21 PM
Hi Nitin,

Could you please send us the control template you use? It will help us in further pinpointing the problem. 

All the best,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Nitin
Top achievements
Rank 1
answered on 01 Dec 2010, 05:22 AM
Hi George,

Here is the control template I am using :

<Style TargetType="{x:Type telerik:ToolWindow}">
    <Setter Property="MinHeight" Value="24"/>
    <Setter Property="MinWidth" Value="85"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Background" Value="#FFF2F2F2"/>
    <Setter Property="BorderBrush" Value="#FF848484"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:ToolWindow}">
                <Grid x:Name="VisualRoot">
                    <Telerik_Windows_Controls_Chromes:ShadowChrome>
                        <telerik:StyleManager.Theme>
                            <telerik:Office_BlackTheme/>
                        </telerik:StyleManager.Theme>
                    </Telerik_Windows_Controls_Chromes:ShadowChrome>
                    <Border Background="Transparent">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="4">
                            <Border BorderBrush="White" BorderThickness="1" CornerRadius="3">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Border x:Name="HeaderElement" Grid.Column="0" Padding="3,1" Margin="2" Grid.Row="0">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1.5" StartPoint="0.5,0">
                                                <GradientStop Color="Black"/>
                                                <GradientStop Color="#FFFAFAFA" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="auto"/>
                                            </Grid.ColumnDefinitions>
                                            <ContentControl x:Name="Header" Grid.Column="0" FontSize="14" Margin="5" Foreground="white" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"/>
                                            <telerik:RadToggleButton x:Name="HeaderDropDownMenu" Grid.Column="1" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.ContextMenuOpen" IsThreeState="True">
                                                <telerik:RadToggleButton.Style>
                                                    <Style TargetType="{x:Type telerik:RadToggleButton}">
                                                        <Setter Property="Width" Value="17"/>
                                                        <Setter Property="Height" Value="17"/>
                                                        <Setter Property="Margin" Value="0,2,2,1"/>
                                                        <Setter Property="IsTabStop" Value="False"/>
                                                        <Setter Property="SnapsToDevicePixels" Value="True"/>
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                                                    <Grid>
                                                                        <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" RenderNormal="False" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderChecked="{TemplateBinding IsChecked}">
                                                                            <telerik:StyleManager.Theme>
                                                                                <telerik:Office_BlackTheme/>
                                                                            </telerik:StyleManager.Theme>
                                                                        </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                                                        <Path x:Name="BackgroundIcon" Data="M0,0L7,0 7,1 6,1 6,2 5,2 5,3 4,3 4,4 3,4 3,3 2,3 2,2 1,2 1,1 0,1z" Fill="White" Height="4" Margin="0,2,0,0" Width="7"/>
                                                                        <Path x:Name="ForegroundIcon" Data="M0,0L7,0 7,1 6,1 6,2 5,2 5,3 4,3 4,4 3,4 3,3 2,3 2,2 1,2 1,1 0,1z" Fill="Black" Height="4" Margin="0,1" Width="7"/>
                                                                    </Grid>
                                                                    <ControlTemplate.Triggers>
                                                                        <Trigger Property="IsMouseOver" Value="True">
                                                                            <Setter Property="Fill" TargetName="ForegroundIcon" Value="Black"/>
                                                                            <Setter Property="Fill" TargetName="BackgroundIcon" Value="White"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsPressed" Value="True">
                                                                            <Setter Property="Fill" TargetName="ForegroundIcon" Value="Black"/>
                                                                            <Setter Property="Fill" TargetName="BackgroundIcon" Value="White"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                            <Setter Property="Fill" TargetName="ForegroundIcon" Value="#FF8D8D8D"/>
                                                                            <Setter Property="Fill" TargetName="BackgroundIcon" Value="White"/>
                                                                        </Trigger>
                                                                    </ControlTemplate.Triggers>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </telerik:RadToggleButton.Style>
                                            </telerik:RadToggleButton>
                                        </Grid>
                                    </Border>
                                    <ContentPresenter x:Name="Content" Grid.ColumnSpan="2" Content="{TemplateBinding Content}" Margin="2,0,2,2" Grid.Row="1"/>
                                </Grid>
                            </Border>
                        </Border>
                    </Border>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="telerik:InputBindingsManager.InputBindings">
        <Setter.Value>
            <InputBindingCollection>
                <MouseBinding Command="telerik:RadDockingCommands.PaneHeaderMenuOpen" MouseAction="RightClick">
                    <MouseBinding.Gesture>
                        <MouseGesture MouseAction="RightClick" Modifiers=""/>
                    </MouseBinding.Gesture>
                </MouseBinding>
            </InputBindingCollection>
        </Setter.Value>
    </Setter>
</Style>
0
George
Telerik team
answered on 02 Dec 2010, 03:47 PM
Hi Nitin,

I suppose you want to open the ContextMenu in the dropdown? If this is true, I would suggest you to change the Command="telerik:RadDockingCommands.ContextMenuOpen" to the Command="telerik:RadDockingCommands.PaneHeaderMenuOpen". The ContextMenuOpen command cannot be executed and that's why it disables the control.

I hope this helps. Please do not hesitate to contact us if you require any further information.

Greetings,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
Docking
Asked by
Nitin
Top achievements
Rank 1
Answers by
George
Telerik team
Nitin
Top achievements
Rank 1
Share this question
or