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.
Hi vijaywadnere,
That code works because the XamMenuItem derives from XamHeaderedItemsControl which in turn derives from ItemsControl. You can actually stick any kind of control into the content area of a XamMenuItem and it will create a sub item for each one in the context menu. It's pretty cool.
It sounds like you resolved the issue yourself. Did you still need help with anything?
Hi,
Thanks for inquiring, I got the issues solved as of now. will shout if needed further help!
Thanks. :)
Let me know if you have any further questions on this matter.