RadContextMenu and checked state

3 posts, 1 answers
  1. Russell
    Russell avatar
    5 posts
    Member since:
    Jul 2008

    Posted 24 Jul 2008 Link to this post

    I have created a RadContextMenu and added an item to the menu with the following code:

        RadMenuItem menuItem = new RadMenuItem(name);
        menuItem.Attributes["State"] = "checked";
        detailMenu.Items.Add(menuItem);

    When the menu is shown there is no check on the menu.

    I have looked at your sample http://www.telerik.com/DEMOS/ASPNET/prometheus/Menu/Examples/CustomAttributes/DefaultCS.aspx which shows usage of checked and unchecked but I cannot get it to work on a ContextMenu

    Regards
    Russell
  2. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 24 Jul 2008 Link to this post

    Hi Russell,

    The State is just a custom attribute in that example. It could have been any other name. You need to observe the ToggleCheck and ApplyImage javascript functions in that example. They just put an image which looks like a checkbox next to the clicked item.

    I hope this will get you started.

    Regards,
    Veskoni
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Russell
    Russell avatar
    5 posts
    Member since:
    Jul 2008

    Posted 24 Jul 2008 Link to this post

    Thanks very much for your prompt response. Indeed you are correct.

    I should probably have spent more time investigating your sample.

    Thanks
    Russell
Back to Top