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

[Solved] Context menu for Header cell not working

1 Answer 144 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
C J
Top achievements
Rank 1
C J asked on 04 Dec 2009, 09:52 PM
Hi,

Right now the grid that i'm using had an "Export" functionality enabled on right click. Now I wish to use the context header menu.
I tried the code present at http://demos.telerik.com/silverlight/#GridView/HeaderContextMenu , but when I right click on the header it still shows "Export". Below is the code i'm using for the grid

 

<telerikGridView:RadGridView x:Name="grdCompleteLoans" ItemsSource="{Binding}" telerikGridViewHeaderMenu:GridViewHeaderMenu.IsEnabled="True" Exporting="RadGridView1_Exporting" CanUserFreezeColumns="False" AutoGenerateColumns="False" IsReadOnly="True" ScrollMode="Deferred" GroupRowStyle="{StaticResource GridViewGroupRowStyle}" Style="{StaticResource RadGridViewStyle}" RowStyle="{StaticResource GridViewRowStyle}" AlternateRowStyle="{StaticResource GridViewRowStyleAlternate}" DataLoadMode="Asynchronous" ShowGroupFooters="True" ShowColumnFooters="True" ShowColumnHeaders="True" ColumnsWidthMode="Auto" UseAlternateRowStyle="True" VerticalAlignment="Top" >

<Navigation:RadContextMenu.ContextMenu>

<Navigation:RadContextMenu ItemClick="RadContextMenu_ItemClick" >

<Navigation:RadContextMenu.Items>

<Navigation:RadMenuItem Header="Export" />

</Navigation:RadContextMenu.Items>

</Navigation:RadContextMenu>

</Navigation:RadContextMenu.ContextMenu>

<telerikGridView:RadGridView.Columns >
....

 </telerikGridView:RadGridView.Columns >
 

 

Please can you tell whether or not i'm missing something.

Thanks.

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 10 Dec 2009, 08:37 AM
Hi C J,

 In your case you need to create dynamic context menu that loads its items depending on the element that has been clicked. I am attaching sample project that illustrates how this can be achieved.

If you have any more questions do not hesitate to contact us.

All the best,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
C J
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or