RadDropDownButton, DropDownOpening event

5 posts, 1 answers
  1. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 27 Mar 2012 Link to this post

    Hello,
    Is there a method to cancel the opening of the drop down in a RadDropDownButton?
    If not, can you please add it as a request for this control?
    Patrick
  2. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 28 Mar 2012 Link to this post

    Hi Patrick,

     You can handle the DropDownOpeningEvent and if you want to stop the opening, just set e.Handled = true. That will prevent the DropDownButton from opening. 
    Hope this helps.

    Greetings,
    Miro Miroslavov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 28 Mar 2012 Link to this post

    Miro,
    the parameter of the DropDownOpening event is an RoutedEventArgs and the RoutedEventArgs class doesn't have have an Handled property.
    That's why I'm asking.
    Patrick
  5. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 30 Mar 2012 Link to this post

    Hi Patrick,

    You can cast the RoutedEventArgs to RadRoutedEventAgrs like so:
    private void RadDropDownButton_DropDownOpening(object sender, RoutedEventArgs e)
    {
        (e as RadRoutedEventArgs).Handled = true;
    }

    This will handle the event. Please give it a try and let us know if it helps.

    All the best,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 30 Mar 2012 Link to this post

    Tina,
    it works!
    But you should consider changing the arguments of the DropDownOpening event to RadRoutedEventArgs for the next release of the RadControls.
    Patrick
Back to Top
DevCraft banner