This is a migrated thread and some comments may be shown as answers.

Is there a way to implement the drag and drop functionality to the grid column, in order to have a custom behavior ?

1 Answer 211 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Salim
Top achievements
Rank 1
Salim asked on 14 Aug 2018, 12:03 PM

Hi, 

Is there a way to implement the drag and drop functionality to the grid column, in order to have a custom behavior ?

What I tried:
  1. Get an access to grid internal services or replace them with my custom services. That would allow me to control behavior of components on low level and reuse their events-emitting systems.
  2. Get an access to grid internal components/directives by using @ViewChild(ren). That would allow me to subscribe on events on child components level.
  3. Implement the d&d functionality by myself without kendo-ui grid API by adding custom mouse events listeners on grid container.

What I got:
  1. All services are private (marked as hidden). It's hard to reference them externally. Replacing them with custom implementation didn't work.
  2. Most of the internal components/directives are also private. Didn't get a valid approach (selector for ViewChild) to get required view elements.
  3. Kendo-ui grid sorting, grouping and reordering features for columns suppress most of the mouse events. It works only for columns with these features turned off.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 16 Aug 2018, 07:39 AM
Hello Salim,

The only built-in and supported drag-and-drop functionality regarding the Grid columns is the reordering functionality:

https://www.telerik.com/kendo-angular-ui/components/grid/columns/reordering/

When a column is reordered via the UI, the columnReorder event is fired that allows for performing some necessary custom logic.

In theory, you can use the Grid column header templates to provide a custom element that can be used as a drag handle and stop the propagation of the mousedown event so that the built-in Grid features that rely on user interaction with the headers will not interfere with the custom logic.

Can you please describe in further details what exactly the custom behavior/functionality related to dragging the Grid columns should be, so I can try suggesting a solution, based on the current API (if one is available). Thank you in advance.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Salim
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or