This is a migrated thread and some comments may be shown as answers.
RadMenuItem Constructor
3 Answers 12 Views
This is a migrated thread and some comments may be shown as answers.
Роберт
Top achievements
Rank 1
Роберт asked on 12 Oct 2017, 01:15 PM

Hello,

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

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Oct 2017, 08:23 AM
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.
0
Роберт
Top achievements
Rank 1
answered on 14 Oct 2017, 11:53 AM

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.

0
Роберт
Top achievements
Rank 1
answered on 14 Oct 2017, 07:55 PM
Oh, heck, it was!!! I'm idiot )))
Asked by
Роберт
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Роберт
Top achievements
Rank 1
Share this question
or