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

Show current selected item for RibbonBarMenu

2 Answers 47 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Ioish
Top achievements
Rank 1
Ioish asked on 30 Nov 2011, 07:28 PM
Hi,
I have searched through the API, the demos and the forum, but I have found no
way at all to let a RibbonBarMenu object show it's current selected item (like a
standard DropDownList would do). I'm using a menu like this in the
QuickAccess menu and need to show the current selected item (at least the
text) either on the menu itself or on a label. Is there any way to
accomplish this?

I guess that the following thread is almost the same, except that it's about the ribbonbartogglelist:

Thanks!

2 Answers, 1 is accepted

Sort by
0
Ioish
Top achievements
Rank 1
answered on 30 Nov 2011, 09:50 PM
I used a RibbonBarButton to acheive the desired effect, however I would like that the QuickAccess item of this button shows the text of the item select instead of just the icon. Is this possible?
0
Bozhidar
Telerik team
answered on 02 Dec 2011, 01:56 PM
Hi Ioish,

To show the selected item's text and image on the menu, add the following function to the OnClientMenuClicked event of the RadRibbonbar:

function onClientMenuItemClicked(sender, args){
    var item = args.get_item();
    var menu = item.get_owner();
    menu.set_text(item.get_text());
    menu.set_image(item.get_imageUrl());
}

The quick access items render img tags, so it's not possible to show the text of the selected item without manipulating the DOM tree.

Regards,
Bozhidar
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
Tags
RibbonBar
Asked by
Ioish
Top achievements
Rank 1
Answers by
Ioish
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or