Drag as well as click in listview item

2 posts, 0 answers
  1. foram
    foram avatar
    3 posts
    Member since:
    Aug 2011

    Posted 07 Nov 2013 Link to this post

    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
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 Nov 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top