Control.AddHandler does not accept Telerik Routed event

4 posts, 1 answers
  1. Kevin Hendriks
    Kevin Hendriks avatar
    56 posts
    Member since:
    Feb 2009

    Posted 03 Nov 2009 Link to this post

    Hello,

    For my demo application I am trying to implement Drag and Drop functionality. But if I am using Silverlight Controls I can not use the following line of code
     (this line of code is from the treeview example DragAndDrop towards the textbox, From the Silverlight Q2 silverlight examples)

    this

     

     

    .target.AddHandler(RadDragAndDropManager.DropQueryEvent,

     

     

     

    new EventHandler<DragDropQueryEventArgs>(TextBox_OnDropQuery));

     


    First of because the Silverlight control has only 1 AddHandler methode wich is the following. Source
    So I added true to it.
    Argument 1: cannot convert from 'Telerik.Windows.RoutedEvent' to 'System.Windows.RoutedEvent' 

    Are the examples not right? Or am I doing something terably wrong because I don't have those methods
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 03 Nov 2009 Link to this post

    Hello Kevin,

    There is an AddHandler extension method and you need the Telerik.Windows namespace to see it.

    Please include

    using Telerik.Windows;

    in your usings.

    Hopefully this will work for you,

    Regards,
    Miroslav
    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.
  3. DevCraft banner
  4. Kevin Hendriks
    Kevin Hendriks avatar
    56 posts
    Member since:
    Feb 2009

    Posted 03 Nov 2009 Link to this post

    With that line of code it works. It might be usefull to include it in the documentation that you need that line.

    I also figured out in the meanwhile that the following line also works without having the namespace.

     

    RadDragAndDropManager

     

     

    .AddDropInfoHandler(target, TextBox_OnDropInfo);

     


    Thanks for the help.
  5. spj11
    spj11 avatar
    18 posts
    Member since:
    Jun 2011

    Posted 04 Apr 2012 Link to this post

    Is AddHandler/RemoveHandler no longer available in Telerik.Windows? Also is there an alternative?
Back to Top