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

RadDropDownButton: Open on MouseDown

5 Answers 160 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 10 Sep 2014, 09:28 AM
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

5 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 12 Sep 2014, 06:29 AM
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
 
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
0
Kiril Vandov
Telerik team
answered on 17 Sep 2014, 08:12 AM
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
 
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

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
Kiril Vandov
Telerik team
answered on 18 Sep 2014, 01:36 PM
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
 
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.
 
Tags
Buttons
Asked by
Alexander
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or