Toobar Button Properties are not being set in Q1 2013 release

6 posts, 0 answers
  1. Timothy
    Timothy avatar
    8 posts
    Member since:
    Aug 2011

    Posted 04 Mar 2013 Link to this post

    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.
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3083 posts

    Posted 05 Mar 2013 Link to this post

    Hi Timothy,

     Indeed, this is a bug in the RadToolBar we have introduced in Q1 2013. We logged it in our PITS where you can track its status. We will do our best to have it fixed for the upcoming internal builds or the SP in the beginning of April the latest. 
    Please excuse us for the inconvenience caused.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Rajaram
    Rajaram avatar
    1 posts
    Member since:
    Jun 2017

    Posted 16 Jun 2017 Link to this post

    Can you please let me know if this issue is fixed in the latest version of Telerik? If yes please guide in using style property for my radbutton.

    Thanks

  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3083 posts

    Posted 20 Jun 2017 Link to this post

    Hi Rajaram,

    We have prepared sample SDK project for such scenarios. Please check it out - it contains readme file and comments in XAML describing the approach and the resources used. Let us know if you need further assistance.

    RadToolBar: CustomStyleElements SDK Sample GitHub


    Regards,
    Petar Mladenov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  5. Rajaram
    Rajaram avatar
    3 posts
    Member since:
    Jul 2007

    Posted 09 Jan 2018 in reply to Petar Mladenov Link to this post

    Thanks for the reply. We are using a custom toolbar class in our application. This custom toolbar inherits Radtoolbar. And we are creating all our toolbars dynamically using this custom toolbar class. The styling used to work fine before but after using the new version of the toolbar the styling doesnt seem to work. Do you have any example to show how to make the styling work in case of dynamically created custom toolbars.

     

    For example if I have a Custom toolbar class called AbcToobar

    Then I am using it as something like below in my xaml

    <controls:AbcToolBar>

    <controls:AbcToolBar.Resources>

    <Style x:Key="abcStyle" TargetType="telerik:RadButton">
                 <Setter Property="cal:Message.Attach" Value="ExecuteCommand"/>...
                      </Style>

    </controls:AbcToolBar.Resources>

    <telerik:RadButton x:Name="abcbutton" Style="{StaticResource abcStyle}"/>

    </controls:AbcToolBar>

     

     

     

     

     

     

  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3083 posts

    Posted 12 Jan 2018 Link to this post

    Hello Raj,

    Your approach might have worked in R1 2013 but runtime theme change would fail and other styling issues made us change the normal way of applying styles to elements in RadToolBar.
    Please use the approach described in the following SDK, it contains useful ReadMe and XAML comments to guide you through the styling approach in RadToolBar:

    ToolBarCustomStyledElements SDK

    Regards,
    Petar Mladenov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top