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 GridView selecting with keyboard is inconsistent #1322

Open
TomQv opened this issue Feb 11, 2019 · 3 comments
Open

WPF GridView selecting with keyboard is inconsistent #1322

TomQv opened this issue Feb 11, 2019 · 3 comments
Milestone

Comments

@TomQv
Copy link

TomQv commented Feb 11, 2019

There are still issues with the WPF-Tree/Gridview with multiselect:

  • impossible to drag multiple selected items, when starting dragging (mouse down on the selection), the selection is cleared

  • behaviour selecting with keyboard with ctrl, up/down keys and space not according to windows standard.
    ctrl-up/down should move the caret up and down, instead it clears the selection and jumps to beginning or end of the list.
    ctrl-pace is not toggling selection of current item, is just ignored.

Any ideas to solve this quickly?

@cwensley
Copy link
Member

Hey @TomQv, thanks for submitting the issue(s).

impossible to drag multiple selected items

It appears dragging multiple items is a general issue with WPF with only hacks as solutions.

However, this appears to work for me, even though it's only necessary on WPF:

myGrid.MouseDown += (sender, e) =>
{
	var cell = myGrid.GetCellAt(e.Location);
	if (cell != null && myGrid.SelectedRows.Contains(cell.RowIndex))
		e.Handled = true;
};

behaviour selecting with keyboard with ctrl, up/down keys and space not according to windows standard.

Welcome to Windows.. where standards exist but are not followed on each of the UI toolkits. Please refer to this document on how the keyboard works with WPF's DataGrid.

If you want it to work differently, perhaps doing searches on how to change the WPF DataGrid selection behaviour would yield some results. Eto doesn't typically change the default behaviour of how controls work on each platform (unless it is glaringly broken). I would welcome changes to provide an option to change this to work more like Windows Explorer, for example.

@cwensley cwensley added this to the Backlog milestone Feb 13, 2019
@greaka
Copy link

greaka commented Aug 12, 2019

Did anyone find a solution to this in the meantime?

The provided code snippet doesn't let me drag files around anymore.

Also, reading up on the documentation for the WPF DataGrid suggests that at the time of this writing, the behaviour should be as intended in the initial request.

@cwensley
Copy link
Member

At least for the first issue (impossible to drag multiple selected items), this should now be fixed with #1505 and #1508

@cwensley cwensley changed the title WPF Gridview Multiselect WPF GridView selecting with keyboard is inconsistent Jan 25, 2021
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

No branches or pull requests

3 participants