Telerik Forums
UI for WPF Forum
6 answers
172 views
Hello,

I am binding the ItemsSource of a RadToolbarTray to a ViewModel property to create one or more toolbars dynamically via the following.

<telerik:RadToolBarTray telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True"
                        ItemsSource="{Binding MergedToolbarCommands}"
                        x:Name="ToolbarTray">
    <telerik:RadToolBarTray.ItemTemplate>
        <DataTemplate>
            <telerik:RadToolBar ItemsSource="{Binding}"
                                OverflowMode="AsNeeded">
                <telerik:RadToolBar.ItemContainerStyle>
                    <Style TargetType="{x:Type ContentPresenter}">
                        <Setter Property="ToolBar.OverflowMode" Value="Never" />
                    </Style>
                </telerik:RadToolBar.ItemContainerStyle>
            </telerik:RadToolBar>
        </DataTemplate>
    </telerik:RadToolBarTray.ItemTemplate>
</telerik:RadToolBarTray>

Unfortunately, the ToolbarTray is not displayed. When I inspect it with Snoop, I notice that all my Toolbars have their DataContexts set correctly and Snoop correctly renders each one individually, but the RadToolbarTray measures itself to have zero height, so it is not displayed. How do I get The RadToolbarTray to measure itself correctly?

Cheers,

Mike
Petar Mladenov
Telerik team
 answered on 04 Feb 2020
2 answers
157 views

Hi, i want to have also "MenuItem" in ToolBar besides normal Buttons. I achieved to do it, but the MenuItem is never opened. Is it necessary to do something more. Or is there any other short way to implement this behavior?

Here it is my xaml

      <telerik:RadToolBar x:Name="toolBar" FocusManager.IsFocusScope="False" HorizontalAlignment="Stretch" Margin="-1 -2 -1 0" BorderBrush="{StaticResource W Grey}" AutoHideOverflowButton="True">
        <telerik:RadButton Margin="2" Command="{Binding LoginCommand}" Content="Login" />
        <telerik:RadButton Margin="2" Command="{Binding LogoutCommand}" Content="Logout" />
        <telerik:RadMenuItem Margin="2">
          <telerik:RadMenuItem Margin="2"  Header="Online Change Compile" Command="{Binding OnlineChangeCompileCommand}">
            <Image Source="../Resources/Images/Toolbar/Icons.16x16.OnlineChangeCompile.png" Stretch="None" />
          </telerik:RadMenuItem>
          <telerik:RadMenuItem Margin="2" Header="Full Compile" Command="{Binding FullCompileCommand}">
            <Image Source="../Resources/Images/ToolBar/Icons.16x16.FullCompile.png" Stretch="None" />
          </telerik:RadMenuItem>
          <telerik:RadMenuItem Margin="2" Header="Full Deploy" Command="{Binding FullDeployCommand}" />
          <telerik:RadMenuItem Margin="2" Header="Online Change Deploy" Command="{Binding OnlineChangeDeployCommand}" />
          <telerik:RadMenuItem.Header>
            <StackPanel Orientation="Horizontal">
              <Image Margin="0" Source="../Resources/Images/Icons.16x16.OpenContextMenu.png" Stretch="None"  Height="16" Width="16" Visibility="{Binding OpenContextMenuVisibility}"/>
              <TextBlock Text="Action" />
            </StackPanel>
          </telerik:RadMenuItem.Header>
        </telerik:RadMenuItem>
      </telerik:RadToolBar>

 

Thanks, Ivo

Ivo
Top achievements
Rank 1
 answered on 09 Jan 2019
1 answer
101 views

Hi Guys,

 

is it somehow possible to override the "IsChecked" style of a RadToggleButton within the RadToolBar?
I would like to have a "working"-spinner animation when a button is pressed.

 

Thank you very much.

Vicky
Telerik team
 answered on 12 Jul 2018
5 answers
82 views
If you have a RadButton in a RadToolbar and the button properties are set in a style, those properties do not get applied at runtime.  If you set the properties directly on the button itself, then they do get set.  This was working before and broke in the latest release.

Example: 
<telerik:RadToolBar x:Class="ToolBarTest.View.ToolBars.StandardToolbarView"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                     xmlns:Controls="clr-namespace:ToolBarTest.Controls"
                     >
    <telerik:RadToolBar.Resources>
        <Style x:Key="Refresh" TargetType="telerik:RadButton">
            <Setter Property="ToolTip" Value="Refresh Set Via Property"/>
        </Style>
    </telerik:RadToolBar.Resources>
        
    <telerik:RadButton x:Name="Refresh" 
                       Style="{StaticResource Refresh}" 
                       Controls:ImageContentSetter.Source="/ToolBarTest;component/Images/document_refresh.png"
                       />
</telerik:RadToolBar>

With the above XAML, the Tooltip is NOT SET on the button.

While here:
<telerik:RadToolBar x:Class="ToolBarTest.View.ToolBars.StandardToolbarView"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                     xmlns:Controls="clr-namespace:ToolBarTest.Controls"
                     >
    <telerik:RadToolBar.Resources>
        <Style x:Key="Refresh" TargetType="telerik:RadButton">
        </Style>
    </telerik:RadToolBar.Resources>
        
    <telerik:RadButton x:Name="Refresh" 
                       Style="{StaticResource Refresh}" 
                       Controls:ImageContentSetter.Source="/ToolBarTest;component/Images/document_refresh.png"
                       ToolTip="Refresh"
                       />
</telerik:RadToolBar>

The tooltip IS SET on the button.

This might seem like a minor thing, but we have MANY buttons in our application and they all take advantage of property setting via styles.  There's NO WAY we are going to go change all of our XAML to work around this.  We cannot upgrade to the Q1 2013 release until this is fixed.
Petar Mladenov
Telerik team
 answered on 12 Jan 2018
1 answer
61 views

Referencing to the sample projects of RadToolBar provided here:
https://github.com/telerik/xaml-sdk/tree/master/ToolBar

 

There's no option to set the mouse cursor to SizeAll when mouse is over the grip visual area.

Martin Ivanov
Telerik team
 answered on 11 May 2017
1 answer
105 views

I have attached a screenshot of my visual studio project where although I have basically copied your toolbar example the 2 buttons are showing vertically and not horizontally. Any ideas what's wrong?

Using 2017.1.222.45

 

Martin
Telerik team
 answered on 14 Mar 2017
21 answers
358 views
Hi. I am having some difficulties using the RadToolBar.
The following code (utilizing the standard toolbar) works just fine:
<ToolBarTray DockPanel.Dock="Top" 
             IsLocked="False"
     <ToolBar BandIndex="0" 
              ToolBarTray.IsLocked="False"
          <Button Click="Button_Click">foo</Button> 
     </ToolBar> 
     <ToolBar BandIndex="0" 
              ToolBarTray.IsLocked="False"
          <Button Command="ApplicationCommands.Cut" 
                  Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" /> 
          <Button Command="ApplicationCommands.Copy" 
                  Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" /> 
          <Button Command="ApplicationCommands.Paste" 
                  Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" /> 
     </ToolBar> 
</ToolBarTray> 
i.e. Commands are active when inside a TextBox otherweise not and the two Toolbars are repositionable inside the ToolBarTray.

However, when I switch to RadToolBar....
<telerik:RadToolBarTray DockPanel.Dock="Top" 
                        IsLocked="False"
     <telerik:RadToolBar BandIndex="0" 
                         telerik:RadToolBarTray.IsLocked="False"
          <Button Click="Button_Click">foo</Button> 
     </telerik:RadToolBar> 
     <telerik:RadToolBar BandIndex="0" 
                         telerik:RadToolBarTray.IsLocked="False"
          <Button Command="ApplicationCommands.Cut" 
                  Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" /> 
          <Button Command="ApplicationCommands.Copy" 
                  Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" /> 
          <Button Command="ApplicationCommands.Paste" 
                  Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}" 
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" /> 
     </telerik:RadToolBar> 
</telerik:RadToolBarTray> 
The Commands are Disabled and do not enable and the ToolBars are not repositionable inside the ToolBarTray.

Have I misread the Documentation on RadToolBar ?

Yours, Nils
Petar Mladenov
Telerik team
 answered on 02 Aug 2016
2 answers
206 views
Is there a way to make the toolbar overflow area horizontal?

Currently it seems to display elements vertically and that not what I desire considering the fact that I'm customizing the layout of the toolbar controls.

Preferably the overflow orientation should match that of the toolbar.
Greg
Top achievements
Rank 1
 answered on 01 Aug 2016
4 answers
608 views
I would like to have a toolbartray with multiple toolbars. In the last toolbar I would like to right align some of the buttons. I can align to the right if there is a single toolbar and no toolbartray but when I add the toolbartray the buttons are no longer aligned to the right. The toolbartray is contained in a grid. Thank you for your help.
Petar Mladenov
Telerik team
 answered on 13 Jun 2016
4 answers
78 views

I'm using a RadToolBar in an Excel task pane. When the task pane is sized to move controls to the overflow, the overflow button will enable but clicking the overflow button will not display the controls. I've further narrowed the problem to when the WPF user control is converted to an INativeControlHandle and back before adding it to the task pane.

 

I've built a sample project to demonstrate the problem. The sample also includes a regular WPF ToolBar which does not have the same problem. (remove the .jpg extension from the .zip file)

 

Note that the same code hosted in a Word addin will function correctly as will a generic WinForms application.

 

Any advice would be appreciated.

klac
Top achievements
Rank 1
 answered on 10 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?