Composite Collections not working for Merging of ContextMenus.

Apr 21, 2009 at 10:29 AM
Hi Guys,

I know we use CompositeCollection to merge context menus from the data grid to its individual row.

But I have this requirement

My Grid's Contextmenu needs should be specified with menu items without composite collection. (This is a client UI Requirement ... developer has no control on this)
e.g.
Test1
Test2

But the row context menu can be created based on a composite collection (as this is in the developer's hands)
e .g.
Test3
Test4

Now I have to add a separator in row context menu. So how do I add separator and menu items from the parent grid's context menu into the composite collection of its individual row (preferrably using XAML Styles)?

In code behind I do this in Row Loading event and it seems to work for the first time
i.e. when I right click on a row it shows me this... 
Test3
Test4
____
Test1
Test2

But then when I right click on grid header it shows me this...
Test1
Test2

And after that, when I right click a row, Test1 and Test2 are not seen in the rows context menu...

All I see is this...
Test3
Test4
____
<Blank>
<Blank>

Its a strange behavior... ideas anyone?

Thx.
Vinit Sankhe.
Apr 22, 2009 at 6:00 AM
Hi Guys

any idea?

:-(