RibbonBarGroup Control Design Break

8 posts, 0 answers
  1. Arpit
    Arpit avatar
    4 posts
    Member since:
    May 2013

    Posted 17 May 2013 Link to this post

    Hi,

    I'm tried to hide RibbonBarButton 'Paste' from first tab by using below script.

    $find('RibbonBarId').findItemByText('RibbonBarButton')._element.style.display = 'none';

    It will appear like ribbonbar_bug_1.png

    first time, I switched to another tab and come to first tab and it looks like ribbonbar_bug_2.png. 

    i have switched to another tab again few time and it breaks the ribbonBarGroup all buttons. (refer ribbonbar_bug_3.png);

    Can any one help me in this?

    Thank You.
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 21 May 2013 Link to this post

    Hello Arpit,

    Can you please clarify why you need to set the style of the RadButton to none? In general I would suggest that you use the set_enabled(false) client-side property of the RadRibbonBarButton as demonstrated below:
    var ribbon=$find ("radribbon1");
    var button1 = ribbon.findButtonByValue("Value1");
    button1.set_enabled(false);

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Arpit
    Arpit avatar
    4 posts
    Member since:
    May 2013

    Posted 22 May 2013 Link to this post

    Hi,

    In my case, I have to show hide that buttons with user credential. if login user has that permission then that button should be shown other wise it's not been visible.

    so, please let me know how to hide that buttons from client side.

    Thanks.
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 May 2013 Link to this post

    Hi,

    Try the following java script to achieve your scenario.
    JS:
    function test()
     {
         var RadRibbonBar1 = $find("<%= RadRibbonBar1.ClientID %>");
         var mainbutton= RadRibbonBar1.findTabByValue("Value");
         mainbutton.findItemByText("Paste")._element.style.visibility = "hidden";
         return false;
     }

    Thanks,
    Princy.
  5. Arpit
    Arpit avatar
    4 posts
    Member since:
    May 2013

    Posted 22 May 2013 Link to this post

    Hi,

    It works fine but still it looks like first screen shot.
    can you please tell me how should i remove that blank space?

    Thank You.
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 May 2013 Link to this post

    Hi Arpit,

    Please try the following JavaScript code.

    JavaScript:
    function test()
    {
       document.getElementsByClassName('rrbControlGroup rrbAbox')[0].style.display = "none";
    }

    Thanks,
    Shinu.
  7. Arpit
    Arpit avatar
    4 posts
    Member since:
    May 2013

    Posted 23 May 2013 Link to this post

    Hi,

    It works fine but how can i find particular button element by ID or CommandName and apply your following javascript.
     
    And one more thing i.e how can i add file uploader button in RibbonBarGroup?

    Thank You.
    - Arpit
  8. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 May 2013 Link to this post

    Hi Arpit,

    I guess you want to upload files using a button in RadRibbonBar. One suggestion is to open a RadWindow containing a RadUpload/RadAsyncUpload control on client side click of a RibbonBarButton.

    Thanks,
    Shinu.
Back to Top