Close a RadDropDown

4 posts, 0 answers
  1. Nick
    Nick avatar
    19 posts
    Member since:
    Oct 2011

    Posted 05 Apr 2012 Link to this post

    I have a grid that I'm using as a faux popup (I don't care for the RadWindow API) and it pops open when clicking various buttons in the RadDropDownButton.  The problem is that the RadDropDownButton stays on top of the popup unless you click off somewhere else.  Is there a close command I can manually send to the RadDropDownButton?  I'd like to attach the event to each button within the RadDropDownButton.

    Thanks!
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 06 Apr 2012 Link to this post

    Hello,
    If you're using ViewModels the best approach is to have  two boolean properties (IsGridVisible and IsDropDownOpen) and two commands that change them (ShowCommand and HideCommand), this way you can control the visibility of the grid and if the DropDown is open or not.
    I've attached a sample project that shows this so could you please examine it and if you have more questions feel free to ask.
    p.s. If you're not using ViewModels you can manually change the IsOpen and the Visibility of the button and the grid in some click event handlers.

    Regards,
    Zarko
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Nick
    Nick avatar
    19 posts
    Member since:
    Oct 2011

    Posted 06 Apr 2012 Link to this post

    Thanks for the quick reply and the code.  I'm not using view models (or C# for that matter).  I converted the code to VB so it was readable, but found there was no close command example.  That's all I need... the command to close the RadDropDownButton.  I couldn't find it in any of the documentation, nor can I find it listed in VS's Intellisense.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 09 Apr 2012 Link to this post

    Hi Nick,

    Thank you for getting back to us. Actually there isn't a command to close the DropDownContent of the button, but you can use the IsOpen property of the button. Setting it to false will close the DropDownContent.

    Please give this a try and let us know if it helps.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top