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

Close a RadDropDown

3 Answers 71 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 05 Apr 2012, 04:20 PM
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!

3 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 06 Apr 2012, 03:41 PM
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 >>

0
Nick
Top achievements
Rank 1
answered on 06 Apr 2012, 03:55 PM
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.
0
Tina Stancheva
Telerik team
answered on 09 Apr 2012, 08:05 AM
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 >>

Tags
Buttons
Asked by
Nick
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Nick
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or