Hello,
Is there a way to open the DropDownContent of the RadDropDownButton not on MouseUp, but already on MouseDown?
I could create an PreviewMouseDown event handler and toggle the IsOpen property. However, the button for some reason also captures the mouse so that I always get an inconsistent behavior on the second click. But when I say e.IsHandled = true, I cannot click any controls inside the popup...
The Idea is that the button should behave similar to a menu:
- The first click on button opens the popup, the second click anywhere outside of the popup closes it.
- A click inside of the popup is ignored by the button (I have different controls inside the popup, not only buttons).
Alex
Is there a way to open the DropDownContent of the RadDropDownButton not on MouseUp, but already on MouseDown?
I could create an PreviewMouseDown event handler and toggle the IsOpen property. However, the button for some reason also captures the mouse so that I always get an inconsistent behavior on the second click. But when I say e.IsHandled = true, I cannot click any controls inside the popup...
The Idea is that the button should behave similar to a menu:
- The first click on button opens the popup, the second click anywhere outside of the popup closes it.
- A click inside of the popup is ignored by the button (I have different controls inside the popup, not only buttons).
Alex
5 Answers, 1 is accepted
0
Hello Alexander,
The RadDropDownButton has a ClickMode property which is controls when the DropDownContent is opened. Setting the ClickMode property to "Press" will force the button to open on MouseLeftButtonDown.
I hope this information helps. Please let us know if you need further assistance.
Kind regards,
Kiril Vandov
Telerik
The RadDropDownButton has a ClickMode property which is controls when the DropDownContent is opened. Setting the ClickMode property to "Press" will force the button to open on MouseLeftButtonDown.
I hope this information helps. Please let us know if you need further assistance.
Kind regards,
Kiril Vandov
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Alexander
Top achievements
Rank 1
answered on 12 Sep 2014, 09:05 AM
Thanks for your answer.
However, it is still not the expected result:
- When I click the button the first time, the DropDownContents shows up, clicking it the second time closes it. This is good.
- However, clicking ouside of the popup does not close it any more, but clicking inside the popup closes it. This is not good...
The KeepOpen property does not seem to have any effect.
Alex
However, it is still not the expected result:
- When I click the button the first time, the DropDownContents shows up, clicking it the second time closes it. This is good.
- However, clicking ouside of the popup does not close it any more, but clicking inside the popup closes it. This is not good...
The KeepOpen property does not seem to have any effect.
Alex
0
Hello Alexander,
I was not able to reproduce the described behavior on our side, I have attached the sample project used in my test. Could you please take a look at it and modify it in order to reproduce the issue on our side. A control inside the DropDownContent may be the cause of the issue.
Looking forward to hearing from you.
Kind regards,
Kiril Vandov
Telerik
I was not able to reproduce the described behavior on our side, I have attached the sample project used in my test. Could you please take a look at it and modify it in order to reproduce the issue on our side. A control inside the DropDownContent may be the cause of the issue.
Looking forward to hearing from you.
Kind regards,
Kiril Vandov
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Alexander
Top achievements
Rank 1
answered on 17 Sep 2014, 11:50 AM
Thanks for your efforts.
I now found the reason: I use my own Style, but the Popup had a wrong name (it was named "PART_Popup" instead of "DropDownPopup"). Therefore, the IsOpen Property of the Poup was not updated automatically (and I did not expect it to happen). Instead instead I created a Binding
Which opens and closes the popup, but had the mentioned side effects. (Indeed, I have another control which is not a button itself but contains the button in its ControlTemplate - and it works this way, so I did not suspect anything to be wrong with the binding).
Alex
I now found the reason: I use my own Style, but the Popup had a wrong name (it was named "PART_Popup" instead of "DropDownPopup"). Therefore, the IsOpen Property of the Poup was not updated automatically (and I did not expect it to happen). Instead instead I created a Binding
IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}"
Which opens and closes the popup, but had the mentioned side effects. (Indeed, I have another control which is not a button itself but contains the button in its ControlTemplate - and it works this way, so I did not suspect anything to be wrong with the binding).
Alex
0
Hello Alexander,
I am glad to hear that you have found a solution for the problem. Please let us know if you need further assistance.
Kind regards,
Kiril Vandov
Telerik
I am glad to hear that you have found a solution for the problem. Please let us know if you need further assistance.
Kind regards,
Kiril Vandov
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.