sub-menu images?

2 posts, 1 answers
  1. Ian
    Ian avatar
    61 posts
    Member since:
    Jul 2010

    Posted 27 Apr 2011 Link to this post

    Hi Telerik

    I am trying to set the image Index for sub menu items in the items collection of a context menu item.

    The ImageIndex property of the sub-menu items does not show the imagelist images associated with the context menu.

    How can I get these images to appear on the sub menu items collection?

    Ian Carson
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 29 Apr 2011 Link to this post

    Hello Ian,

    Just retrieve the corresponding item, and get the image from either the menu.ImageList or the image list itself, like so:
    var menu = new RadMenu();
    var menuItem = new RadMenuItem("Some menuItem");
    menu.ImageList = imageList1;
    menuItem.ImageIndex = 1;
    var subMenuItem = new RadMenuItem("Some submenuItem");
    subMenuItem.Image = menu.ImageList.Images[1];

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
  3. DevCraft banner
Back to Top