This is a migrated thread and some comments may be shown as answers.

Context menu for TreeColumn

1 Answer 42 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Anne Lyon
Top achievements
Rank 1
Anne Lyon asked on 14 Jan 2013, 09:40 AM
Hi, I would like to attach a context menu to a tree-column in the task-tree. Preferable only child tasks and not parent (summary) tasks.
I have implemented the code in one of your examples (RadContextMenu_MVVM) and the context menu works fine if I for instance attach it to an EventContainer:
in MainPage.xaml:
<Setter Property="telerik:RadContextMenu.ContextMenu" Value="{Binding Path=ContextMenu, Source={StaticResource ContextMenuHolder}}" />

But if I add the same line for a TreeCellContainer the context menu does not display:

<Style TargetType="telerik:TreeCellContainer" BasedOn="{StaticResource TreeCellEContainerStyle}">
    <Setter Property="telerik:RadContextMenu.ContextMenu" Value="{Binding Path=ContextMenu, Source={StaticResource ContextMenuHolder}}" />
</Style>

My treeView columns are defined like this:
<telerik:RadGanttView.Columns>
     <telerik:ColumnDefinition  Header="Progress" ColumnWidth="40" >
         <telerik:ColumnDefinition.CellTemplate>
             <DataTemplate>
                 <StackPanel Orientation="Horizontal">
                      <Image x:Name="imgKlipp" Source="{Binding Progress, Converter={StaticResource DblToImageConverter}}" HorizontalAlignment="Right" Stretch="None" />
                 </StackPanel>
             </DataTemplate>
         </telerik:ColumnDefinition.CellTemplate>
     </telerik:ColumnDefinition>
       
     <telerik:TreeColumnDefinition Header="AO'er" MemberBinding="{Binding Title}" ColumnWidth="160">
     </telerik:TreeColumnDefinition>
 </telerik:RadGanttView.Columns>

It is only the TreeColumnDefinition I want a context menu for, NOT the ColumnDefinition.
Am I using the right target container for the items in the treeview? How do I make sure only the child tasks/events have a context menu in the task tree and not the parent summarty tasks?

Anne

1 Answer, 1 is accepted

Sort by
0
Ventzi
Telerik team
answered on 15 Jan 2013, 11:13 AM
Hello Anne,

I've noticed that you have the same forum post here where I answered your question. Please let's continue our conversation there.

All the best,
Ventzi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GanttView
Asked by
Anne Lyon
Top achievements
Rank 1
Answers by
Ventzi
Telerik team
Share this question
or