I've below XAML in my XAMGrid definition: <ig:XamContextMenu x:Name="myContextMenu" ItemClicked="myContextMenu_ItemClicked" Opening="myContextMenu_Opening"> <ig:XamMenuItem x:Name="menu1" Header="Menu First" /> <ig:XamMenuItem x:Name="menu2" Header="Menu Second" /> </ig:XamContextMenu>
I need to have a dynamic combobox in each of these two menuitems. Dynamic means - i'll be adding the comboitems on the fly.
OR: Is there a way to show a UI Control (I'll create it with required controls on it) and show as a context menu on a XamGrid?
Cool.... this is working!!
Before posting my question, I wasnt sure if it'll work.
<ig:XamMenuItem x:Name="menu1" Header="Menu First"> <StackPanel Orientation="Vertical"> <BTELibrary:BTELabel Content="Some Label: " /> <ComboBox x:Name="cmb1" Width="150" > <ComboBoxItem >Item 1</ComboBoxItem> <ComboBoxItem>Item 2</ComboBoxItem> </ComboBox> </StackPanel> </ig:XamMenuItem>
Dont know how! but I am getting a context menuitem and the Stack panel as its sub menu!? It allows me the select the combobox items, and the menu disappears when I click on the somewhere else on the empty are of the menu (space around combo/label).
aha!!
Was looking for this:
ContextMenuService.GetManager(myGridObject)ContextMenu.IsOpen = false;
to close the context menu on any event on the control (combo/button) etc.