This is a migrated thread and some comments may be shown as answers.

Using ParagraphImageMenuItemViewMode - How to trigger click event?

1 Answer 53 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 04 Mar 2011, 02:39 AM
Hi,
I was able to successfully trigger the click event for radmenu with the below.  But how would it work for ParagraphImageMenuItemViewMode?  I have a mix of regular menu item and paragraph image menu.
How do I retrieve the title for paragraphimagemenu instead of the header?  I would like to get the title to case select when user selects the paragraphimagemenuitem.
 

private

 

 

void MenuItemClick(object

sender, RoutedEventArgs e)

 

 

 

{

 

RadRoutedEventArgs args = e

 

 

 

as

RadRoutedEventArgs;

 

 

 

RadMenuItem menuItem = args.OriginalSource

 

 

 

as

RadMenuItem;

 

 

 

 

 

 

 

string

page = Convert.ToString(menuItem.Header);

 

 

 

 

 

switch

(page)

 

 

 

{

 

 

 

 

 

case "Bar"

:

 

 

 

 

 

 

 

 

// LoadPage1();

 

 

 

 

 

 

break

;

 

 

 

 

 

 

 

case "Chart"

:

 

 

 

 

 

 

 

 

// LoadPage2();

 

 

 

 

 

break

;

 

 

 

}
}

Thanks

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 08 Mar 2011, 09:01 AM
Hi Eric,

I think you can cast the DataContext of the RadMenuItem to ParagraphImageMenuItemViewMode and get the properties you want.

Regards,
Pana
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Menu
Asked by
Eric
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or