RadContextMenu doesn't attach to Canvas in Group Header

1 posts, 0 answers
  1. Sergey
    Sergey avatar
    26 posts
    Member since:
    Jun 2012

    Posted 03 Jul 2012 Link to this post

    When I attach RadContextMenu to Canvas inside DataTemplate of GroupHeaderControlTemplate, group header's context menu gets overriden by the context menu that is attached to the ScheduleView:

    <telerik:RadScheduleView.GroupHeaderContentTemplate>
        <DataTemplate>
            <Canvas Width="100">
                <telerik:RadContextMenu.ContextMenu>
                    <telerik:RadContextMenu>
                        <telerik:RadMenuItem Header="Group Header Context Menu" />
                    </telerik:RadContextMenu>
                </telerik:RadContextMenu.ContextMenu>
            </Canvas>
        </DataTemplate>
    </telerik:RadScheduleView.GroupHeaderContentTemplate>

    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu>
            <telerik:RadMenuItem Header="Schedule View Context Menu" />
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>

    It works if you use TextBlock instead of Canvas in DataTemplate, but I want the context menu to appear even if the user doesn't right-click directly on the TextBlock but anywhere in the group header cell. The way I'm trying to achieve this is by putting transparent canvas over TextBlock and any other element I will put inside DataTemplate.
Back to Top