Telerik Forums
UI for Silverlight Forum
4 answers
98 views

Seems it does not work for me:

<UserControl.Resources>
    <DataTemplate DataType="vm:MenuItemViewModel" x:Key="ToolBarItemTemplate">
        <c:TemplateSelector TemplateKey="{Binding MenuItemType}" Content="{Binding}">
            <c:TemplateItem x:Key="{t:Static Member=vm:MenuItemType.Button}">
                <t:RadButton IsEnabled="{Binding IsEnabled}" Content="{Binding Text}"
                             Command="{Binding Command}" ToolTipService.ToolTip="{Binding ToolTip}" t:RadToolBar.OverflowMode="{Binding OverflowMode}" />
            </c:TemplateItem>
            <c:TemplateItem x:Key="{t:Static Member=vm:MenuItemType.Checkbox}">
                <t:RadToggleButton IsEnabled="{Binding IsEnabled}" Content="{Binding Text}"
                                   Command="{Binding Command}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"
                                   ToolTipService.ToolTip="{Binding ToolTip}" t:RadToolBar.OverflowMode="{Binding OverflowMode}" />
            </c:TemplateItem>
        </c:TemplateSelector>
    </DataTemplate>
</UserControl.Resources>
 
<t:RadToolBarTray e:RadToolBarTrayExtensions.ItemsSource="{Binding Items}" VerticalAlignment="Center">
    <t:RadToolBarTray.ItemTemplate>
        <DataTemplate DataType="vm:MenuViewModel">
            <t:RadToolBar ItemsSource="{Binding Items}" ItemTemplate="{StaticResource ToolBarItemTemplate}" />
        </DataTemplate>
    </t:RadToolBarTray.ItemTemplate>
</t:RadToolBarTray>

This t:RadToolBar.OverflowMode="{Binding OverflowMode}" is ignored. Even if I set it directly to "Never" or "Always"...

Art
Top achievements
Rank 1
 answered on 27 Jun 2016
1 answer
67 views

I have an RadToolbar control on my Page. The problem is the Images I have placed on my buttons don't show. My code seems fine. Whats the issue?

<telerik:RadToolBar Grid.Row="1"

    Margin="20,20,5,10">

<Button Width="25"

Click="OnInsertClick">

<Image Source="Images/add.png"/>

</Button>

<Button Width="25">

<Image Source="Images/delete.png"/>

</Button>

</telerik:RadToolBar>

 

I also tried addressing like /Images/add.png but to no avail

Evgenia
Telerik team
 answered on 17 Feb 2016
4 answers
77 views
like the controls on the left of expression blend ?

csaey
Petar Mladenov
Telerik team
 answered on 06 Feb 2015
6 answers
180 views
Hi there, I want to tweak the padding on RadButtons shown within a RadToolBar.

I can't do this with an implicit style - it just gets ignored completely, although it works fine on RadButtons that are not in a RadToolBar.

I can't use an explicit style on the RadButtons either, because this wipes out the container style from the RadToolBar.

All I want to do is increase the padding on these buttons so that they are consistent with other RadButtons elsewhere in the app. Is there a simple way to do this that doesn't involve extracting and modifying all the control templates for RadToolbar?

Thanks!

Sam
Petar Mladenov
Telerik team
 answered on 26 Feb 2014
4 answers
73 views
Hi ,
I have about 12-15 buttons in the RadToolBar and when the available display size is low the buttons move to the Overflow Menu, it looks nice. But unfortunately my buttons in the overflow menu wont work. They don't fire the command attached to them. However the buttons which are visible on the Toolbar work fine. Interestingly enough the Click event handler gets fired when the buttons are in the Overflow menu. I can not understand why my Command would not get fired ?

This is my code.
"
<telerik:RadToolBar x:Name="quickKeyBar" Grid.Row="0" 
                                     telerik:StyleManager.Theme="Metro"
                                ItemsSource="{Binding Path=UserQuickKeys}"
                                HorizontalAlignment="Stretch" Margin="-1 -2 -1 0">
 
                <telerik:RadToolBar.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <telerik:RadButton Margin="3,0,3,0" Content="{Binding Path=QuickKeyName}"
                                           Command="{Binding Path=EnterQuickKeyCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"     
                                           CommandParameter="{Binding}"
                                           IsEnabled="{Binding Path=IsUserQuickKeyUsable}"                                     
                                           telerik:StyleManager.Theme="Metro" />
                        </Grid>
                    </DataTemplate>
                </telerik:RadToolBar.ItemTemplate>

"


Any help is greatly appreciated. 

Cheers,
Nachiket
Nachiket
Top achievements
Rank 1
 answered on 15 Jul 2013
1 answer
35 views
Hi,
We use RadComboBox in our Silverlight applocation. Perfect for large itemsSouce!!!
But I try to change default value för  ButtonChrome background to lightblue 

<LinearGradientBrush x:Key="ControlBackground_MouseOver" StartPoint="0.5,0" EndPoint="0.5,1">

 

 

 

<GradientStop Color="#FFBDE4F9" Offset="0" />

 

 

<GradientStop Color="#FFB4E0F7" Offset="0.5" />

 

 

<GradientStop Color="#FF98D1EF" Offset="0.5" />

 

 

<GradientStop Color="#FF81C3E5" Offset="1" />

 

 

</LinearGradientBrush>

 

in
-------
<vsm:VisualState x:Name="MouseOver">

<Storyboard>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome"   Storyboard.TargetProperty="RenderMouseOver">

 <DiscreteObjectKeyFrame KeyTime="0:0:0">

 <DiscreteObjectKeyFrame.Value>

 <sys:Boolean>True</sys:Boolean>

 </DiscreteObjectKeyFrame.Value>

 </DiscreteObjectKeyFrame>

 </ObjectAnimationUsingKeyFrames>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Background">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOver}" />

 </ObjectAnimationUsingKeyFrames>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Foreground">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOver}" />

 </ObjectAnimationUsingKeyFrames>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_MouseOver}" />

 </ObjectAnimationUsingKeyFrames>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_MouseOver}" />

 </ObjectAnimationUsingKeyFrames>

  </Storyboard>

 </vsm:VisualState>

 <vsm:VisualState x:Name="DropDownOpen">

 <Storyboard>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Pressed}" />

 </ObjectAnimationUsingKeyFrames>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Pressed}" />

 </ObjectAnimationUsingKeyFrames>

 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Background">

 <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOver}" />

 </ObjectAnimationUsingKeyFrames>

 </Storyboard>

 </vsm:VisualState>

-----

 but unsuccessfully :(
Cannot change theme in Blend, get error
Would be very grateful for any suggestion.

Best regards
Elena
Pavel R. Pavlov
Telerik team
 answered on 15 May 2013
1 answer
32 views
I have a toolbar where all horizontally aligned elements fit in. Now i resize the window so narrow that some of the toolbar elements get hidden in the overflow drop down menu. This works perfectly. I open the drop down overflow menu to see all elements. With the opened menu i resize the window wider again. All items fit in the toolbar again and the drop down menu is not needed anymore. BUT the empty drop down overflow menu stays open! Please see attached files
Petar Mladenov
Telerik team
 answered on 01 May 2013
5 answers
85 views
So setting the Background property of RadToolBar works if it's an actual color like Red, Green or Blue. Setting it to Transparent however doesn't work. It just ends up some grayish color. Maybe make it so it at least is consistent, or am I making a mistake here?
Tina Stancheva
Telerik team
 answered on 11 Mar 2013
3 answers
58 views
Is it possible to bind a view model observable collection to a RadToolBarTray and have it rendered as a RadToolBar?

I've tried various ways and can't get it to work.
Viktor Tsvetkov
Telerik team
 answered on 01 May 2012
6 answers
226 views
Hi telerik,
I'm using Telerik controls for Silverlight 2011 Q3 SP1 ver. 2011.3.1220.1040
I added a RadButton into a RadToolBar like below sample code:
<telerik:RadToolBar x:Name="radTB"
              Height="40">
  <telerik:RadButton HorizontalContentAlignment="Center"
               Background="Transparent"
               BorderThickness="0"
               Width="40">
      <StackPanel>
          <Image Width="16"
              Height="16"
              Source="/BusinessApplication1;component/Image16.png" />
          <TextBlock Text="Click"></TextBlock>
      </StackPanel>
  </telerik:RadButton>             
</telerik:RadToolBar>
In code-behind, I modified width of that RadButton to 200 but nothing changes in UI.
Then how can I modified width of a RadButton because I need change width of control in RadToolbar in many situations.
Hope you can provide a project sample soon.

Thanks.
Tina Stancheva
Telerik team
 answered on 29 Feb 2012
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?