This question is locked. New answers and comments are not allowed.
Hi,
I need to generate RadMenuItems dynamically at runtime. here is my code:
My issue is with the Click event , when ever I click any newSubItem , first of all the "newSubItemCreateSimilar_Click" fires and then "newItem_Click" fires as well which is really strange! I need it to call just "newSubItemCreateSimilar_Click" .
Is there anything I'm doing wrong????
I'd be thankful if you assist me on this,
Many thanks,
Naseem
I need to generate RadMenuItems dynamically at runtime. here is my code:
Telerik.Windows.Controls.RadMenuItem newItem;
Telerik.Windows.Controls.RadMenuItem newSubItem;
foreach (var item in lstResult)
{
newItem = new Telerik.Windows.Controls.RadMenuItem() { Header = item.Title, IconTemplate = (System.Windows.DataTemplate)this.Resources["IconTemplateBestMatches"], Tag = item.Code };
newSubItem = new Telerik.Windows.Controls.RadMenuItem() { Header = "Create Similar", IconTemplate = (System.Windows.DataTemplate)this.Resources["IconTemplateCreateSimilar"], Tag = item.Code };
newSubItem.Click += new Telerik.Windows.RadRoutedEventHandler(newSubItemCreateSimilar_Click);
newItem.Items.Add(newSubItem);
newItem.Click += new Telerik.Windows.RadRoutedEventHandler(newItem_Click);
selItem.Items.Add(newItem);
}
My issue is with the Click event , when ever I click any newSubItem , first of all the "newSubItemCreateSimilar_Click" fires and then "newItem_Click" fires as well which is really strange! I need it to call just "newSubItemCreateSimilar_Click" .
Is there anything I'm doing wrong????
I'd be thankful if you assist me on this,
Many thanks,
Naseem