Hi,
Please do the following:
1. Set the TreeView's AllowDragDrop to true. This is necessary to enable drag and drop in general. If you only wish to allow drap and drop reordering, you can handle the TreeView's ClientSideOnDragBegin, then check the argument to see if drag and drop is allowed in the current context. If it is not allowed, you would return false to cancel drag drop on that node. You may also need to handle ClientSideOnDragDrop;
2. Handle the TreeView's CustomItemCreated event. Inside the event handler you must set the newly created CustomItem object's CancelBubble to false:
Code: C#
protected void TreeView1_CustomItemCreated(
object sender, EO.Web.NavigationItemEventArgs e)
{
//Allows the mouse event to bubble up to the TreeView
e.CustomItem.CancelBubble = false;
}
This is needed to allow the mouse event to bubble up to the treeview. Otherwise the treeview will not see the mouse event thus will not start drag and drop;
3. Add the following CSS rules into your page:
Code: CSS
.custom_item
{
display: none;
}
.treeview table
{
display: block;
}
4. Apply CSS class "treeview" to TreeView's top group:
Code: HTML/ASPX
<eo:TreeView ....>
....
<TopGroup Style-CssText="....." Style-CssClass="treeview">
.....
</TopGroup>
....
</eo:TreeView>
Note the new Style-CssClass added to TopGroup.
5. Apply CSS class "custom_item" to your table element in the custom item:
Code: HTML/ASPX
<TemplateItem>
<CustomItem>
<table class="custom_item" .....>
.....
</table>
</CustomItem>
</TemplateItem>
Step 1 and 2 are always necessary. Step 3, 4, 5 are needed due to a bug with custom item drag and drop. We will fix that bug in our next build so you won't need it in the future.
Hope this helps. Please let us know if it works for you.
Thanks!