Click here to Skip to main content
15,070,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

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 :-)

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900