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

How to select RibbonButton

3 Answers 45 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 27 Jun 2013, 08:21 PM
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

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 02 Jul 2013, 01:28 PM
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.
0
David
Top achievements
Rank 1
answered on 02 Jul 2013, 01:32 PM
Hi Kate,

I basically just want to highlight the last clicked button and select the tab belonging to that button.
0
Kate
Telerik team
answered on 05 Jul 2013, 12:27 PM
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.
Tags
RibbonBar
Asked by
David
Top achievements
Rank 1
Answers by
Kate
Telerik team
David
Top achievements
Rank 1
Share this question
or