-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add Support For DataGrid DoubleTap Events Specific to the DataGridRows #2249
Comments
ping @harinikmsft |
That seems like a valid ask, we might want to take a look at other DataGridRow** events that we may want to add as part of this. Marking this as a feature request for the future. |
Duplicate of #2388 |
Definitely think a "RowPressed" and "RowDoublePressed" would be a big positive. This is not difficult to implement in the control either. Hoping this feature request is implemented in the next release. As a bonus please consider "ColumnHeaderPressed" and "ColumnHeaderDoublePressed" as well |
@robloo In the application I'm building, users currently have to manually select the row before right-clicking in order to display the row-appropriate context menu. Otherwise, it just displays the column header context menu. I think it would be more user-friendly to have a RowRightTapped which autoselects the nearest row and fires (all on rightclick). |
@duke7553 I do the same thing in my application. When a right click is detected, I select the row under the click/press. A context menu is then displayed. Full code is below if this will help you :) For sure more of this should be 'out-of-the-box' functionality of the DataGrid. I also think we need to stay away from the "Tapped" terminology -- this is specific for touch inputs. The generic "Pressed" is better for this I think. View Code
|
@robloo Thank you for this code! I agree, this should be implemented out-of-the-box within DataGrid. |
Since @harinikmsft was collecting a list of events that we may want to add for this, I have summarized as follows:
|
We are not adding features to this DataGrid at this time. I know you already added some feedback along these lines to the WinUI discussion issue - feel free to add more if anything comes up. Thanks! |
Closing this request since these features are not being added at this time. |
I'm submitting a...
## Current behavior
Currently, to interact with a DataGrid's rows, you must specify a SelectionChanged event. This can become inefficient and somewhat confusing when users are able to select more than one items. Because of this, I would like the functionality to only execute the SelectedItem code when a row is DoubleTapped. Previously, it was possible to add an EventSetter to the DataGridRows' style (As mentioned here: https://stackoverflow.com/questions/22790181/wpf-datagrid-row-double-click-event-programmatically), but since EventSetter is now not apart of UWP, I am left without this functionality.
## Expected behavior
My proposed solution is to add a "RowDoubleTapped" event directly to the UWP DataGrid class itself. I need this to be easily accessible from my XAML code. This already exists with the ListView class which has a similar "ItemClicked" event as an alternative to SelectionChanged.
## Minimal reproduction of the problem with instructions
Create a project using a DataGrid (with a binded ItemSource) that requires DoubleTap event functionality on the DataGridRows themselves. The current DoubleTapped event is not row-specific, meaning it covers the entire DataGrid. I attempted to use this event only to find that the sender was returning a DataGrid rather than a DataGridRow.
Environment
``` Nuget Package(s): Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
Package Version(s): 3.1.0-preview1 (LATEST as of 6/15/2018)
Windows 10 Build Number:
App min and target version:
Device form factor:
Visual Studio
The text was updated successfully, but these errors were encountered: