Disable Row Drag for certain rows

1 Answer 72 Views
TreeList
Arman
Top achievements
Rank 1
Iron
Arman asked on 10 Feb 2023, 10:37 AM

Is it possible to disable or simply remove the icon for the drag action on a row in a treelist? I have a scenario where the children under specific parent should not be able to be dragged to another parent or change its position withing the parent group.

 

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 Feb 2023, 07:53 AM

Hi Arman,

Yes, it is possible to disable TreeList row dragging conditionally. Use the OnRowRender event and some custom CSS.

  1. Use the OnRowRender handler to determine whether the item (args.Item) should be draggable.
  2. If not, set some custom CSS class to args.Class.
  3. Use the CSS code below.

tr.my-no-drag-class .k-drag-cell {
    pointer-events: none;
}
tr.my-no-drag-class .k-drag-cell .k-icon {
    display: none;
}

Regards,
Dimo
Progress Telerik

Learn about the important changes coming in UI for Blazor 4.0 in January 2023!
Tags
TreeList
Asked by
Arman
Top achievements
Rank 1
Iron
Answers by
Dimo
Telerik team
Share this question
or