Click here to Skip to main content
11,934,809 members (50,786 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET Telerik
Hi all

I m working on Radlistview Drag n drop feature.....I ve to match items in one listview with other ...Right Now Im able to do it using drag and drop n giving unique colors to items ..but to make it more interactive i need to draw a line between the two radlistview items ( to identify which has been matched to which) ..can anyone suggest how to do it ???

Thanks in advance
Posted 22-Sep-12 4:41am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I haven't used the latest version of Telerik, but to my knowledge there is no build in solution for this so you will need to write it yourself.

You can add/overwrite some eventhandlers for the dragBegin(onMouseDown) and dragEnd(onMouseUp). In the dragBegin you should store the current mouse coordinates for future use, javascript array or json in a hidden field would be my choice. In the dragEnd do the same for the 2d coordinate.
Next you have 2 coordinates, and you can draw a line between them by using one of many different jQuery plugins, or write your own (Wikipedia Bresenham[^] and plot small divs).

This will however be harder if the listview can be scrolled in, because then you will need to factor in the scroll height of both lists and use some offset calculations.

There might be other/better ways, but this is the way I would probably do it.
Hope this helps you get started Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100