How to select RibbonButton

4 posts, 0 answers
  1. David
    David avatar
    4 posts
    Member since:
    Jun 2013

    Posted 27 Jun 2013 Link to this post

    Hi !

    I want to select a ribbonbutton via server side, is it possible? I did not see any property to make a button selection, only the tabs, and that i'm not being able to make it work.

          var selectedButtonCookie = Request.Cookies.Get("selectedButton");
                if (selectedButtonCookie != null)
                {
                    var button = ribbonBar.FindButtonByValue(selectedButtonCookie.Value);

                    if (button != null)
                    {
                        ribbonBar.SelectedTabIndex = button.ParentWebControl.TabIndex;
                    }
                }

    Thanks in advance
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 02 Jul 2013 Link to this post

    Hello David,

    You can use the FindButtonByValue property in order to get the needed button from the RadRibbonBar control. However, I am not quite sure what you mean by trying to select a button. Can you please clarify on that?

    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. David
    David avatar
    4 posts
    Member since:
    Jun 2013

    Posted 02 Jul 2013 Link to this post

    Hi Kate,

    I basically just want to highlight the last clicked button and select the tab belonging to that button.
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 05 Jul 2013 Link to this post

    Hello David,

    You can easily set the desired button as clicked by using the CssClass property of the button and set the desired css class. You can try out the code example below and check if this helps:
    RadRibbonBar1.FindButtonByValue("ButtonValue").CssClass = "rrbButtonClicked";

    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