How to implement both drag drop and selection in datagrid

2 Answers 154 Views
Grid
w
Top achievements
Rank 1
w asked on 05 Jan 2023, 11:02 AM

Hi,

    I try to implement drag drop row and selection row in datagrid, So I try your demo code https://www.telerik.com/kendo-react-ui/components/grid/rows/row-reordering/.

 

but when I just add 'selectable' property to the demo code, The drag-drop behavior looks strange, after that, I add all selection code in demo https://www.telerik.com/kendo-react-ui/components/grid/selection/, It is still can not drag drop normally

is it a bug? or currently not support both drag-drop and selection row?

 

 

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 09 Jan 2023, 07:22 AM

Hi,

I will share the answer from the support ticket here as well:

Since the selection relies on the row click, enabling drag and drop of the rows at the same time will interfere with the selection functionality. For enabling selection and drag and drop at the same time I would recommend using the checkbox selection demonstrated in the following example: 


With the checkbox selection you will also have to disable the built-in selection, so that the selection is limited only to the checkboxes:

        selectable={{
          enabled: false,
        }}

 

Regards,
Konstantin Dikov
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.

0
Thomas
Top achievements
Rank 1
Iron
answered on 10 Aug 2023, 06:41 AM | edited on 10 Aug 2023, 07:11 AM

Hey,

I am having the same issue here, trying to make the row selectable and the grid reorderable with the help of drag and drop.

Especially since we are clicking on the drag handle to drag an item, it should be possible to disable this interference with the click on the row, maybe with a stopPropagation or something ?

Any workaround you may provide please ?

Thank you,

Regards,

Thomas

Konstantin Dikov
Telerik team
commented on 11 Aug 2023, 11:42 AM

Hello Thomas,

I have to say that preventing the propagation of the click event is not possible and enabling the selection in combination with the built-in selectable is currently not supported.

Using the checkbox select column and implementing custom selection (by handling the onRowClick event) are the only valid solutions for enabling both functionalities:

 

Tags
Grid
Asked by
w
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Thomas
Top achievements
Rank 1
Iron
Share this question
or