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

Drag as well as click in listview item

1 Answer 13 Views
ListView
This is a migrated thread and some comments may be shown as answers.
foram
Top achievements
Rank 1
foram asked on 07 Nov 2013, 11:50 PM
Hello,

I want on my listview item user can drag it over some list as well they can click on that item as well,below is my code which works fine in firefox,google chrome and safari but IE is not happy with my code.   

<asp:LinkButton runat="server" ID="LinkButton1"  CommandName="profiledetails"  CommandArgument='<%# Eval("id")%>' >
                                            <div id="Div1" style="position: relative; z-index: 10;margin-top: -180px;top:0px;left: 0px;"  >
                                                <telerik:RadListViewItemDragHandle ID="RadListViewItemDragHandle1" Height="160" Width="160"   
                                                    CssClass="dragdrophandleimage" runat="server" ToolTip="Drag and drop it on the list to">
                                                </telerik:RadListViewItemDragHandle>
                                            </div>
                                            </asp:LinkButton>

Can anyone help me with this? I should be drag the whole item as well as i should be able to click listview item as well.Is there any better way to achieve this?

Please help,
Thanks
Foram

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 12 Nov 2013, 10:43 AM
Hello Foram,

You can implement any type of drag-drop with RadListView. The control does not limit you in any way. The client-side OnItemDragging event provides you with the dragged item and any event that you need:
function itemDraggingHandler(sender, args)
{
    //The HTML DOM event
    var evt = args.get_domEvent();
    //The event target (the current hovered element)
    var target = evt.target || evt.srcElement;
    //The display index of the dragged item
    var draggedIndex = sender._itemDrag._draggedItemIndex;
    //The original HTML dragged item
    var grabbedItem = sender._itemDrag._grabbedItem;
}

I hope this help.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ListView
Asked by
foram
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or