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

[Solved] Issue with Adding Content Menu to RadGridView

2 Answers 114 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.
Carolyn
Top achievements
Rank 1
Carolyn asked on 29 May 2009, 03:05 PM

When trying to add a context menu to a RadGridView, I have used the example code provided by Telerik, but am getting an error with the following statement:

rowContextMenu.AddHandler(RadMenuItem.ClickEvent, new RoutedEventHandler(OnMenuItemClick));

The error message is: "No overload for method 'AddHandler' takes '2' arguments"

So, I saw that the AddHandler method was expecting a third parameter (bool handledEventsToo), and although it said that the default value was false , it was requiring that I specify the value anyway.  OK, so now I have the following statement, but a new error:

rowContextMenu.AddHandler(RadMenuItem.ClickEvent, new RoutedEventHandler(OnMenuItemClick), false);
 
Error Message 1:  "Argument '1': cannot convert from 'Telerik.Windows.RoutedEvent' to 'System.Windows.RoutedEvent'"

At first, I thought I may not have have referenced all appropriate assemblies, but I have copied all references from the example code:

 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Resources;
using System.Xml;
using System.Xml.Linq;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;

 

Has anyone else experienced this issue?

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 29 May 2009, 03:10 PM
Hello Joe,

Please add using Telerik.Windows - our method is extension method in this namespace.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Carolyn
Top achievements
Rank 1
answered on 29 May 2009, 03:14 PM
That did the trick.  Thanks!
Tags
GridView
Asked by
Carolyn
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Carolyn
Top achievements
Rank 1
Share this question
or