Setting button width in %, firefox problem.

2 posts, 0 answers
  1. Ken Lester
    Ken Lester avatar
    4 posts
    Member since:
    Jul 2009

    Posted 08 Oct 2009 Link to this post

    When i set the width of the toolbar button in percentage, firefox(v3.5.3) will not be able to display correctly. Any solution?
                                    <telerik:RadToolBar ID="RadToolBar1" runat="server" CausesValidation="False" Skin="Sunset" 
                                        OnClientButtonClicking="OnClientButtonClicking" AutoPostBack="True"  
                                       style="display:block; float: none"
                                          <telerik:RadToolBarButton runat="server"  Text="Add New" 
                                                CommandName="AddNew" Width="20%"
                                            <telerik:RadToolBarButton runat="server" Text="Delete" 
                                                CommandName="DeleteFile" Width="20%"
                                            <telerik:RadToolBarButton runat="server"  Text="Refresh" 
                                                CommandName="Refresh" Width="20%" > 
                                            <telerik:RadToolBarButton runat="server" Text="AutoRefresh OFF" 
                                                CommandName="Autorefresh" AllowSelfUnCheck="True" CheckOnClick="True" Width="20%"
                                            <telerik:RadToolBarDropDown runat="server" Text="Filter Files" > 
                                                    <telerik:RadToolBarButton runat="server" Text="All Files" CommandName="FilterAllFile" Width="20%"
                                                    <telerik:RadToolBarButton runat="server" Text="Ready Files" CommandName="FilterReadyFile"
                                                    <telerik:RadToolBarButton runat="server" Text="Error Files" CommandName="FilterErrorFile"
                                                    <telerik:RadToolBarButton runat="server" Text="Processing Files" CommandName="FilterProcessingFile"

  2. Yana
    Yana avatar
    4604 posts

    Posted 12 Oct 2009 Link to this post

    Hello Ken,

    You cannot set the width of RadToolBar buttons in percentages. You should set it in javascript in OnClientLoad event handler of the toolbar:

    <script type="text/javascript">
            function clientLoad() {
                var toolbar = $find("<%=RadToolBar1.ClientID %>");
                var btnWidth = toolbar.get_element().clientWidth / 5;
                for (var i = 0; i < toolbar.get_items().get_count();  i++)
                    toolbar.get_items().getItem(i).get_element().style.width = btnWidth + "px";
            window.onresize = clientLoad;

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top