Enherit from RadButton and Click Events

3 posts, 1 answers
  1. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 20 Jul 2011 Link to this post

    I have created a button that enherits from RadButton

    When i click the button, the click event is not raised on the enheritted button.

    I know it has to do with routed events... i know you can have a class handler that bubbles the event up.

    But... I have two enheritted buttons on my form, each has his own click event handler. Because of the class handler when i click one button, the click events on both buttons is raised.

    How can i make an instance handler that will allow specifying an event on both of enheritted buttons like one does with normal buttons?
  2. Answer
    Zarko avatar
    755 posts

    Posted 25 Jul 2011 Link to this post

    Hi Peter,
    Unfortunately I'm not quite sure what's the problem because I wasn't able to reproduce it. When I inherit our RadButton everything seems to be working fine. Could you please examine the attached sample project and see if is of any help to you.
    If need further assistance please feel free to ask, but I'd like to ask you if you could send us some code snippets or a project that reproduces the issue.

    All the best,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 26 Jul 2011 Link to this post

    Hello Zarko,

    The problem was a little more complex. I Use a RadButton in a composite control. The composite control itself uses a Style with a ControlTemplate. I finally fixed it by using a RoutedEventHandler.

    Thank you for your help!

Back to Top