Get Dropped RadListViewItem ID

2 posts, 0 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 18 Jul 2010 Link to this post

    Hi, I can get the sender id by args.get_itemIndex();, how can i get the destinationElement(which must also be a radlistviewitem) ID and/or clientvalue?
  2. Rosen
    Rosen avatar
    3247 posts

    Posted 21 Jul 2010 Link to this post

    Hi James,

    I'm afraid that the destination item's index is not available, through itemdropping eventArgs. As RadListView is a "look-less control" it is hard to determine which portion of the rendered html it the actual item without cluttering the output with useless markup. Thus there is no client-side object representation of the data items.

    However you can track the id of the destinationItem by hooking to its mouseover and mouseout events and saving the DisplayIndex in order to retrieve it from dropping handler. Similar to the following:

        <telerik:RadListView runat="server" ID="RadListView1">
                <div class="rlvI">
                    <telerik:RadListViewItemDragHandle ID="RadListViewItemDragHandle1" runat="server" />
            <ClientSettings AllowItemsDragDrop="true">
                <ClientEvents OnItemDropping="itemDropping" />
        <telerik:RadListView runat="server" ID="RadListView2">
                <div class="rlvI" onmouseover='itemMouseOver("<%#Container.DisplayIndex %>")' onmouseout='itemMouseOut();'>
    <script type="text/javascript">
        var currentDestinationIndex = -1;
        function itemDropping(sender, args) {
            var destIndex = currentDestinationIndex;
            alert("dragged item index:" + args.get_itemIndex());
            if (destIndex > -1) {
                alert("destination index:" + destIndex);
            else {
                alert("Not over RadListView2 items");
        function itemMouseOver(displayIndex) {
            //save the id in a variable when dragged item is over
            currentDestinationIndex = displayIndex;
        function itemMouseOut() {
            //clear the variable if dragged item leaves 
            //destination item boundaries
            currentDestinationIndex = -1;

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top