Click here to Skip to main content
11,637,176 members (62,167 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET jQuery

I Need Drag and Drop a Row Functionality Between 2 GridView Control in ASP.NET Version 2.0.
Eg., If i Drag a Row from GridView1 and Drop to GridView2. How i will get the data of Row from GridView1 in the GridView2 (GridViewClass) .......

Please post your ideas.
Thanks in Advance......
Posted 21-Sep-12 2:33am
Edited 2-Dec-12 4:10am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

it's not very hard. i explains some steps for you.

1). write a method in javascript to copy the current row cells values in an array (this function will be called when mouse down will fire on source row).

2). write a method in javascript to paste the copied values from array to destination row cells (this function will be called when mouse up will fire on destination row).

Note: some validations may takes place e.g. Array contains data or not when mouse up fire on destination row

i m not writing code here because i want that u self try it to make batter yourself. if u found more problems while writing code then i will provide complete code.

Dinesh Tailor
Sr. Software Engineer
kanna.kannanbe at 22-Sep-12 1:03am
Thanks for your Feed back: Dineshshp

I already implemented (Drag and Drop Functionality )with jQuery,but what i am facing problem is , how to get the data for that droped row in the Second GridView2,using GridViewRow Class.Here i am using FindControl Function for finding the data from the Droped Row from Gridview1.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can do this using jQuery. Check Connect Lists[^].

Also check all the links in - Re: How to drag and drop one row from grid view to another grid view in[^]
kanna.kannanbe at 22-Sep-12 1:05am
Thanks for your Feed back : Tadit Dash
Tadit Dash at 22-Sep-12 1:57am
Please don't forget to mark this as accepted answer, if it has helped you in any way, so that it will be helpful for others to know the solution easily... You will also be awarded with points for accepting... :) :)
Thanks a lot...

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

Solution 3

This can be done using Jquery's Draggable and Droppable interactions.

See this example. This example illustrates how to drag a gridview row and drop it in a details view. You can use the same logic and implement drag and drop between two gridviews.

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

  Print Answers RSS
0 OriginalGriff 295
1 stibee 288
2 270
3 Sergey Alexandrovich Kryukov 214
4 himanshu agarwal 184
0 OriginalGriff 9,031
1 Sergey Alexandrovich Kryukov 8,513
2 Mika Wendelius 6,922
3 F-ES Sitecore 2,388
4 Suvendu Shekhar Giri 2,320

Advertise | Privacy | Mobile
Web04 | 2.8.150728.1 | Last Updated 26 Dec 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