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

RadListView custom drag handle definition

3 Answers 149 Views
ListView
This is a migrated thread and some comments may be shown as answers.
deva sudan
Top achievements
Rank 2
deva sudan asked on 29 Dec 2010, 09:51 PM
Scenario1: I'm trying to set the custom drag handle for the list view items.    I used the below code snippet to my Listview control Image item. The below "onmousedown" event works fine for the first time of page load of Radlistview.  

   <
ItemTemplate>
       
<div class="rlvI">
           
<div class="rlvDrag"
            
onmousedown="Telerik.Web.UI.RadListView.HandleDrag(event, '<%# Container.OwnerListView.ClientID %>', <%# Container.DisplayIndex%>)">
           
</div>
       
<div>
   
</ItemTemplate>

Isssue:  Within application I'm changing the listview data and populating through AJAX method.   After the data gets rebinded in the RadListview the event is not working and not able to drag the items.   Do I need to dynamically set this event for new Listview items at runtime ?    How do I set this "onmousedown" event dynamically in the codebehind while populating the listview ? 

Scenario2: Similar issue happens if I use the RadListViewItemDragHandle, it is throwing item_drag is null during the mousedown of the draghandle item for the second time after listview rebind.  I'm thinking the item is not set correctly for dynamically changing listview items in both the scenarios.   

 Any help is much appreciated..



Thanks

3 Answers, 1 is accepted

Sort by
0
deva sudan
Top achievements
Rank 2
answered on 03 Jan 2011, 07:02 PM
Some more details on the same issue,   Looks like the  binding expressions to get the ClientID "Container.OwnerListView.ClientID " is returning null for the items that were getting binded using AJAX method.   The initial page load of the RadlistView is working fine for drag/drop but later if I change the content of RadListView in AJAX manner the dragged item is not getting the client ID.   
 
<
div class="rlvDrag"
            
onmousedown="Telerik.Web.UI.RadListView.HandleDrag(event, '<%# Container.OwnerListView.ClientID %>', <%# Container.DisplayIndex%>)">
           
</div>

How do I set the client ID for the radlistview items that are rebinded dynamically on AJAX method.    Any insight on how to narrow down this issue is much appreciated.   Thanks in advance..
0
Vasil
Telerik team
answered on 04 Jan 2011, 04:24 PM
Hello,

Based on the provided information I was not able to replicate the issue. Onmousedown event should work fine after rebind. And Container.OwnerListView.ClientID should not be null.

If you are unable to resolve this please open a formal support ticket and send us a sample project that we can debug.

All the best,
Vasil
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
deva sudan
Top achievements
Rank 2
answered on 05 Jan 2011, 01:40 AM
Thanks for investigating on this issue.  I was able to figure out the problem.  Looks like my AJAX settings were not correctly done and it was missing the listview control during update.    I fixed the AJAX setting and it now works fine as expected..  Thanks again..
Tags
ListView
Asked by
deva sudan
Top achievements
Rank 2
Answers by
deva sudan
Top achievements
Rank 2
Vasil
Telerik team
Share this question
or