Handling User's Long Press in RadDataGrid

1 Answer 78 Views
DataGrid
Nick
Top achievements
Rank 1
Nick asked on 31 Jul 2024, 03:50 PM | edited on 31 Jul 2024, 03:51 PM

I want to be able to handle when a user does a long press on a row, and get the data item as the parameter to the command. Is there a way to this already, or is the only solution to create a custom behavior that uses a custom gesture?

I have tried using community toolkit touchbehavior, since it is a platform behavior it does not have reference to the grid or data item. Binding the SelectedItem in the view model does not get set in time -- the value in the view model is null when the command fires. I also tried Binding the CommandParameter to the SelectedItem, binding to the dataGrid by reference, which is null in the command parameter as well.

Any suggestions are welcomed, thanks for reading.

1 Answer, 1 is accepted

Sort by
0
Accepted
Didi
Telerik team
answered on 01 Aug 2024, 07:41 AM

Hello Nick,

We have this request logged as a feature request here: https://feedback.telerik.com/maui/1619280-datagrid-add-long-press-hold-selection-gesture-on-a-row-cell Press the vote button and follow button to track item's progress. Now there isn't an option to achieve hold/long press gesture. This must be implemented on control level. 

The gesture that is used in the control is the tap gesture. All commands the control provides are described here: https://docs.telerik.com/devtools/maui/controls/datagrid/commands/overview 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DataGrid
Asked by
Nick
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or