In RadListView, an arbitrary HTML element can be your drag handle. The little RadListViewItemDragHandle control is provided for convenience, but you are not limited to using that only. To make an HTML element a drag handle, the following conditions should be met
1. The drag handle element must have a CSS class of "rlvDrag
2. The drag handle element must have an onmousedown
event handler in the form:
)._itemDrag._dragHandleMouseDown(event, [DisplayIndex of dragged item]);
is the client ID of the RadListView instance and [DisplayIndex of dragged item]
is the RadListViewDataItem.DisplayIndex
value of the item that is dragged.
3. The topmost container in the ItemTemplate
of the listview must have a CSS class of "rlvI
" (for alternating items)
4. The topmost item container (with class="rlvI"
) cannot be the same as the drag handle (with class="rlvDrag"
So, effectively, the above points require that you explicitly specify your topmost item container (that will be dragged) as well as the drag handle element that will be used for dragging.
In your particular scenario, you want your drag handle to be the entire item container. As you cannot use one and the same element for both your item container and your drag handle, you need at least 2 elements. Here is a sample ItemTemplate declaration in your markup:
'$find("<%= RadListView1.ClientID %>")._itemDrag._dragHandleMouseDown(event, <%# Container.DisplayIndex %>);'
<%--My item content here--%>
This is the minimum of markup you need to make an arbitrary element your drag handle.
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>