RadMenuItem Constructor

4 posts, 1 answers
  1. Robert
    Robert avatar
    56 posts
    Member since:
    Feb 2010

    Posted 12 Oct Link to this post

    Hello,

    One of RadMenuItem constructors is new RadMenuItem("TEXT", object Tag)..
    How do I retrieve that Tag value in code?

    Thanks

  2. Answer
    Dess
    Admin
    Dess avatar
    2196 posts

    Posted 13 Oct Link to this post

    Hello, Robert,  

    Thank you for writing.  

    Here is a sample code snippet demonstrating how to use access the Tag property of the RadMenuItem
    public RadForm1()
    {
        InitializeComponent();
     
        RadMenuItem item = new RadMenuItem("File", "Tag info");
        this.radMenu1.Items.Add(item);
        item.Click+=item_Click;
    }
     
    private void item_Click(object sender, EventArgs e)
    {
        RadMenuItem item = sender as RadMenuItem;
        RadMessageBox.Show(item.Tag.ToString());
    }

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Robert
    Robert avatar
    56 posts
    Member since:
    Feb 2010

    Posted 14 Oct in reply to Dess Link to this post

    Thank you Dess,

    I'm using 2015 package and there is no such property as Tag in RadMenuItem, but I have solved it casting sender to RadElement.
    Thank you very much.

  4. Robert
    Robert avatar
    56 posts
    Member since:
    Feb 2010

    Posted 14 Oct in reply to Robert Link to this post

    Oh, heck, it was!!! I'm idiot )))
Back to Top