I was reading this thread:
http://www.telerik.com/community/forums/wpf/gridview/column-chooser.aspx
Can you please post a working wpf example since I cannot get the code to compile when I replace the rad context menu with the standard windows context menu. Can you please post a working copy using the wpf rad grid view for all of us to use?
Bill
11 Answers, 1 is accepted
Working example can be found here: http://demos.telerik.com/wpf/?GridView/HeaderContextMenu
Sincerely yours,
Vlad
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.
Thanks Vlad for the reply. Can you please post the source code to this thread as a .zip file? That way I can download it and see what I am doing incorrectly. For some reason, I cannot find a link to download the sample source code project.
Thanks.
Bill
I'm attaching a sample project using the code from the online demo for your reference.
Hope this helps.Greetings,
Anastasia
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.
Thank you. I am not being clear on what I actually need. Let me try to explain this again.
The original post that I submitted to this thread had a link to an example project for silverlight. It said to replace the radContextMenu with the windows context menu. This was what I was trying to do and could not get the source code to compile. When I was asking for sample source code on how to perform this task, I was asking if you could please use a normal windows context menu and normal menu item in the sample source code in your project. Can you please post a working sample of this concept using the default windows context menu and default windows menu item?
Thanks!
First of all sorry for the misunderstanding.
I'm attaching a sample application using the default windows context menu and default windows menu item.
I hope I understood it correctly this time.
Best wishes,
Anastasia
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.
Thank you... we are almost there! I am using an older version of the rad gridview so it does not support some of the newer properties that you are using in your sample source code. The version of the rad gridview that I am using is this:
v2.0.50727
2009.1.312.35
Can you please provide me the source code to accomplish this task using this version of your rad grid view control?
Thanks!
Bill
I've attached an example project.
Greetings,
Vlad
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.
On a button click, is it possible to invoke a telerik datagrid column chooser context menu?
A code snipped will be appreciated
Thanks,
Priya
I would recommend you to run through this blog post for a reference.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
In order to add the RadContextMenu to a RadGridView please refer to the Use Rad Context Menu with a RadGridView documentation article. Then you could follow these steps:
1. Attach an Event Handler to the ItemClick event of the RadContextMenu:
<
telerik:RadContextMenu
x:Name
=
"gridContextMenu"
ItemClick
=
"gridContextMenu_Clicked"
/>
2. Get the clicked Item from the RadContextMenu in the EventHandler method:
private
void
gridContextMenu_Clicked(
object
sender, RoutedEventArgs e)
{
RadMenuItem clicked = e.OriginalSource
as
RadMenuItem;
}
3. Based on the custom logic of your application you can Add or Remove Columns to the RadGridView:
this
.myGridName.Columns.Add(
new
Telerik.Windows.Controls.GridViewDataColumn()
{
DataMemberBinding =
new
Binding(
"MyPropertyName"
)
});
this
.myGridName.Columns.RemoveAt(0);
In addition you can check our Silverlight RowContextMenu online demo. The implementation for WPF is the same.
Let me know if you need any further assistance.
Best Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.