RibbonBarToggleButton client side issue

4 posts, 1 answers
  1. Abhilash
    Abhilash avatar
    9 posts
    Member since:
    Dec 2012

    Posted 09 Oct 2013 Link to this post

    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
  2. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 11 Oct 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Abhilash
    Abhilash avatar
    9 posts
    Member since:
    Dec 2012

    Posted 15 Oct 2013 Link to this post


    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>

  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 21 Oct 2013 Link to this post

    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.
Back to Top