Show current selected item for RibbonBarMenu

3 posts, 0 answers
  1. Ioish
    Ioish avatar
    9 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

    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. Ioish
    Ioish avatar
    9 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

    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?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 02 Dec 2011 Link to this post

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