Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF ComboBoxCell: only elements within the rows bounding box can be selected #1658

Closed
ManuelHu opened this issue Apr 22, 2020 · 5 comments · Fixed by #1662
Closed

WPF ComboBoxCell: only elements within the rows bounding box can be selected #1658

ManuelHu opened this issue Apr 22, 2020 · 5 comments · Fixed by #1662
Milestone

Comments

@ManuelHu
Copy link
Contributor

While the issue is mostly resolved (it works generally - but not all values can be selected), exactly the described issue still persists. When trying to select an element outside the bounding rectangle of all rows - but within the gridview, the drop down will just close and no value will be selected.

To be clear, with "rows bounding box" i mean the data area and specifically not the GridViews bounding box. That works. Every element of the drop down in the marked red areas can be selected, only "Normal" does not work:

dropdown-bounding

Expected Behavior

I can select all elements that are available in the drop down.

Actual Behavior

Only those elements which lie within the bounding rectangle or outside the grid control of the rows can be successfully clicked on. Even the same element can't be selected if the mouse pointer is outside the bounding box, while it works within.

Specifications

  • Version: 2.5.1-ci-20200407.2 (should be the latest)
  • Platform(s): WPF
  • Operating System(s): Windows 10
@cwensley
Copy link
Member

Oh fun, thanks for reporting the issue!

@cwensley cwensley added this to the 2.5.1 milestone Apr 22, 2020
@cwensley
Copy link
Member

Hmm.. I can't seem to reproduce this with Eto.Test.Wpf, which has a similar UI:

Screen Shot 2020-04-23 at 10 02 10 PM

Perhaps you have some code in MouseDown/Up/etc/CellClick events that may be causing it?

@cwensley cwensley modified the milestones: 2.5.1, 2.x Apr 24, 2020
@ManuelHu
Copy link
Contributor Author

I see, my screenshot was rather bad as you can't see the borders of the GridView... ;-) My code does not contain any event handlers in this specific dialog.

Items that are outside the GridView bounding box can be selected (like in your screenshot). The GridView page in the test application is therefore rather bad for reproducing, as there is no whitespace inside the Gridview below the rows (there are too many).

You can use the "Kitchen sink" tab to reproduce:

Items outside the GridView border can be selected:

  1. LoI7WIMTyh

Here, only "Grid Combo 3" can be selected, but only when you click on a point outside the GridView border (e.g. the lower fifth of the item, which can be quite hard to hit right with your mouse...). "Grid Combo 1" and 2 cannot be selected and will cancel edit.

Items outside the rows bounding box don't work, inside they do:
grafik

Here "Grid combo 1" and 2 can be easily selected, because their drop down items are on top of other rows. "Grid Combo 3" cannot be selected. Any click will just cancel edit.

I hope I could make it more clear. Thanks for your work!

@ManuelHu
Copy link
Contributor Author

It's GridHandler.cs, Line 403 that triggers the (wrong) CommitEdit() which discards the just selected item, as the DropDown has not been closed.

I suppose there is no way for ComboBoxCellHandler.Column.CommitCellEdit to get the drop down item the mouse is just hovering over. No click has been bubbled to the ComboBox at that moment.

It seems that swm.VisualTreeHelper.HitTest(Control, e.GetPosition(Control))?.VisualHit; does not return editing controls, so this condition triggers.

Removing the full conditional block would fix the selection issue, but obviously would disable the Commit-on-Click-on-whitespace feature.

Just removing the e.Handled = true; (Line 407) does not do the trick, because the event would not reach the actual combobox before the Commit() is executed.

@cwensley
Copy link
Member

@ManuelHu ah, that makes sense to me now, thanks for clarifying the issue! I'll dig further.

@cwensley cwensley modified the milestones: 2.x, 2.5.1 Apr 24, 2020
ManuelHu added a commit to FPLedit/FPLedit that referenced this issue Apr 27, 2020
* Fixes picoe/Eto#1658: WPF ComboBoxCell: only elements within the rows bounding box can be selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants