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

Drag and Drop is not working when TreeView has link items

1 Answer 106 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard Koslik
Top achievements
Rank 1
Richard Koslik asked on 28 Nov 2016, 03:59 PM

I have a partial view that receives a model filled with data that can be bound to the Kendo TreeView like this:

  @(Html.Kendo().TreeView()
            .Name((string)ViewBag.TreeName)
            .DragAndDrop(true)
            .BindTo(Model, (NavigationBindingFactory<TreeViewItem> mappings) =>
            {
              mappings.For<MenuItemModel>(binding => binding
                .ItemDataBound((item, model) =>
                {
                  item.Text = model.Text;
                  item.ActionName = model.Action;
                  item.ControllerName = model.Controller;
                  item.ImageUrl = model.Icon;
                  if (model.Items == null || model.Items.Count == 0)
                  {
                    item.Id = model.Action;
                  }
                  item.Enabled = true;
                })
                .Children(model => model.Items)
              );
            })
            .Animation(true)
            .AutoScroll(true)
            .Events(e =>
            {
                e.Drag("MainMenuDrag").Drop("MainMenuDrop").DragStart("MainMenuDragStart");
            })
  )

My problem is that the Drag & Drop functionality only works when the icon of a treeview item is dragged. When the text is dragged the event handlers do not even get called. Is this intended? If yes then, is there a work around for this issue?
I need the links (anchor tags) because I have an event handler bound to them that requires both the url and the id properties from the dataItem.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 30 Nov 2016, 11:41 AM
Hello,

I was able to reproduce the issue and track it down to Q3 2015, when it was introduced. I am afraid that currently there is no workaround for it. I've logged a public issue for it, where you may track its progress and add comments. As a small token of gratitude for reporting it to us, I updated your Telerik points.

Regards,
Dimitar
Telerik by Progress
Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Tags
TreeView
Asked by
Richard Koslik
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or