Color Picker opening

Editors for WPF Forum

Posted 5 years ago by Antoine Picard
Avatar

Hi,

I was thinking about something, what about opening the color picker when you click on the little square displaying the actual color ?

When my grid is really wide and I have multiple consecutive color Pickers, it's a bit hard to find the correct button to click on. 

It would be easier if I could click on the display square.

Would it be possible ?

Comments (4)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Antoine,

I'm not sure we're going to add that since it's a bit non-standard behavior-wise, but you could always set the IsEditable property to false.  When that is false, clicking anywhere on the control will open the popup because it acts like a non-editable ComboBox at that point.  Perhaps that would yield a better user experience in your scenario?

Or alternatively, you could possibly handle the PreviewMouseDown event and watch for a click on the left 20 or so pixels of the control.  Then set the control's IsPopupOpen property to true in that scenario.


Actipro Software Support

Posted 5 years ago by Antoine Picard
Avatar

Hi !

I think it's a really standard behavior but anyway.

I still need to be able to edit the hexa value so IsEditable = false doesn't solve my problem.

I handled the PreviewMouseDown event without watching for a specific spot and it worked for the whole edit box but the displaying square. It correctly goes through the event, the colorEditBox.IsPopupOpen = true is triggered but nothing happens.

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I believe what happens here is that if you don't also mark e.Handled = true, the click may get processed by an ancestor ScrollViewer, which could steal focus and trigger the popup to close immediately.  Give that a try to see if it helps.


Actipro Software Support

Posted 5 years ago by Antoine Picard
Avatar

Hi !

You were right ! Thanks a lot !

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.