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

One context menu for many gridviews?

1 Answer 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andi
Top achievements
Rank 2
Andi asked on 27 Jan 2011, 12:03 PM
Hi there,

is it possible (and how) to create just one context menu for different GridViews?
In my case I have a Window with a TabControl containing 3 tabs. Each Tab contains a GridView. I want to create one ContextMenu which will be shown in each GridView.

Greetings
Andi

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 28 Jan 2011, 04:38 PM
Hello Andi,

You may define an implicit style targeting GridViewRow and set the ContextMenu property:

<Window.Resources>             
     <Style TargetType="telerik:GridViewRow">
         <Setter Property="ContextMenu">
             <Setter.Value>                 
                 <ContextMenu>
                     <MenuItem Header="Add" />
                     <MenuItem Header="Delete" />                       
                 </ContextMenu>                 
             </Setter.Value>
         </Setter>
     </Style>
</Window.Resources>
 

Regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Andi
Top achievements
Rank 2
Answers by
Maya
Telerik team
Share this question
or