This is a migrated thread and some comments may be shown as answers.

RibbonBarGroup Control Design Break

7 Answers 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arpit
Top achievements
Rank 1
Arpit asked on 17 May 2013, 12:43 PM
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.

7 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 21 May 2013, 03:03 PM
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.
0
Arpit
Top achievements
Rank 1
answered on 22 May 2013, 06:06 AM
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.
0
Princy
Top achievements
Rank 2
answered on 22 May 2013, 06:37 AM
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.
0
Arpit
Top achievements
Rank 1
answered on 22 May 2013, 11:58 AM
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.
0
Shinu
Top achievements
Rank 2
answered on 23 May 2013, 07:01 AM
Hi Arpit,

Please try the following JavaScript code.

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

Thanks,
Shinu.
0
Arpit
Top achievements
Rank 1
answered on 23 May 2013, 08:27 AM
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
0
Shinu
Top achievements
Rank 2
answered on 31 May 2013, 12:25 PM
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.
Tags
General Discussions
Asked by
Arpit
Top achievements
Rank 1
Answers by
Kate
Telerik team
Arpit
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or