I'm using the new RadDropDownButton and placed a list box inside. After an item is selected by the user I want to close the DropDownContent programmatically without any additional user action.
Does anyone know how to do this?
Thanks for your help
Uwe
13 Answers, 1 is accepted
Bye
Uwe
Thank you for your interest in the RadButtons.
Actually you find the right way. The only thing you should do is to set the button's IsOpen property to False at the right moment.
If you have any other questions about RadButtons please do not hesitate to contact us.
Kind regards,
Ivan
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.
Is there any way to set the drop down button to close automatically when an item is selected? My drop down button is in a data template, so I don't have easy access to the object be able to set "IsOpen" in this manner. I tried walking up the visual tree to the parent, but of course there are grids, stackpanels, and who knows what else in between so the code gets ugly fast.
Any thoughts would be appreciated!
Nate
you can use a class handler to handle the event you need on the RadDropDownButton. Please read more on the class handlers here:
http://wildermuth.com/2010/01/28/Handing_Events_with_Care
Regards,
Valentin.Stoychev
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Thanks for the idea. This didn't work out well in my scenario, since to add the handler in this manner I also need access to the object. Having said that I learned a lot about bubbling of handled events in the post!
In the end (for anyone else trying to do this), I did the following:
In the mouseenter event, I grab a reference to the raddropdownbutton:
If mSeriesDrop Is Nothing Then |
mSeriesDrop = TryCast(sender, RadDropDownButton) |
End If |
Then in my menu click events, I add the following:
If mSeriesDrop IsNot Nothing Then |
mSeriesDrop.IsOpen = False |
End If |
Yes, the IsOpen property get and set the state of the drop-down button. Manipulating its value is the right way to deal with the button drop-down-state.
Regards,
Ivan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
In my case IsOpen didn't work always. Sometimes the RadDropDownButton is open but the value of IsOpen = false so I can close it anyway.
Have you any idea why the IsOpen - property is not valuated correctly?
Thanks, Mariya
We are not aware of such problem with RadDropDownButton, nor we wasn't able to reproduce the described issue.
Can we ask you to provide us with a sample project demonstrating the problem?
How are you checking the value of the "IsOpen" property while the RadDropDownButton is open?
Greetings,
Vladislav
the Telerik team
I have a RADDropdownButton and am working on MVVM pattern. In this pattern, I do not have the access to the control in the view. How can I close the dropdown list by setting its IsOpen property to false after clicking it ?
By the way, it seems to me that the click event fires twice when I click on the list. Are you aware of it by any chance?
Thanks in advance.
Chen
Clicking on a RadDropDown fires only once the Click event. You can check this out in the attached project. On the other hand, currently we have an issue when the button's IsOpen is set to True initially the button is not open. Is this related to your question ? We will do our best to have this fixed for the upcoming Q2.
Kind regards,Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
May this will help someone like me.
silverlight development | silver light application