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

RibbonBarToggleButton client side issue

3 Answers 52 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Abhilash
Top achievements
Rank 1
Abhilash asked on 09 Oct 2013, 06:07 AM
Hi all,

I want to toggle RibbonBarToggleButton in client side. I tried  togglebutton.Toggled = true; But there is no effect. I tried server side code, its working fine. How can I solve this.
NB: I am using Telerik  2013.1.220.40


Thank you
abhi

3 Answers, 1 is accepted

Sort by
0
Accepted
Kate
Telerik team
answered on 11 Oct 2013, 09:18 AM
Hello Abhilash,

You can use the client-side get_toggled() and set_toggled() properties of the toggled button. For example you can use the following code to get the toggle state of a particular toggle button:

function OnClientApplicationMenuItemClicking(sender, args) {
          sender.findToggleButtonByValue(
"toggle1").get_toggled();  }

 

Regards,
Kate
Telerik
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 the blog feed now.
0
Abhilash
Top achievements
Rank 1
answered on 15 Oct 2013, 02:09 PM

Thank you Kate..It is working fine.

 Can you help me to find  ddlText and set an item selectable on a button click (client side)
<telerik:RibbonBarDropDown ID="ddlText"   Width="97" >
                                        <Items>
                                            <telerik:RibbonBarListItem Text="Arial" />
                                            <telerik:RibbonBarListItem Text="Calibri (body)"  Selected="true" />
                                            <telerik:RibbonBarListItem Text="Comic Sans" />
                                            <telerik:RibbonBarListItem Text="Tahoma" />
                                            <telerik:RibbonBarListItem Text="Verdana" />
                                        </Items>
                                    </telerik:RibbonBarDropDown>

0
Kate
Telerik team
answered on 21 Oct 2013, 12:46 PM
Hello Abhilash,

To access the needed item from the RibbonBarDropDown you can find it by its index. For example the following code returns the text of the first RibbonBarListItem:
//here I find the ribbonbar first 
var ribbon = $find("ribbonbar1");
//here I get the first tab, the first group and then the third element in the group which is the RibbonBarDropDown
//then I get the text of its first item
ribbon.getTab(0).getGroup(0).getItem(2).get_items().getItem(0).get_text();

To adjust it to your particular scenario you might need to change the indexes of the tabs, the groups and the items.

Regards,
Kate
Telerik
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 the blog feed now.
Tags
RibbonBar
Asked by
Abhilash
Top achievements
Rank 1
Answers by
Kate
Telerik team
Abhilash
Top achievements
Rank 1
Share this question
or