Context Menu heirachy

I created a page (A) with a datagrid and put a contextmenu o nt row of the datagrid and it works as expected.

I then created another page (B) and put a tab control with a context menu this works as expected.

I then added the first page (A) to a tab on the second page (B) as a custom control and now when I right click on the datagrid in A expecting contextmenu A to appear I get the context menu from B instead.

How do i solve this?

This is probably DOM event bubbling. You can try adding @oncontextmenu:stopPropagation="true" to page (A) or to its outermost element.