Groups | Blog | Home
all groups > dotnet windows forms > march 2006 >

dotnet windows forms : Drag and Drop with DataGridView


cnickl
3/26/2006 9:27:02 PM
I’m trying to implement a Drag and Drop between two DataGridViews.
Unfortunately all the examples I can find online use ListBoxes and a method
called IndexFromPoint to determine the target location of the drop. Well,
DataGridView doesn’t have this method and I have no idea how to determine the
target index. Is there any code example or does anyone know what method to
Braulio Diez
3/27/2006 1:59:02 AM
Hello,

I found a sample about DataGridView drag and drop in codeproject, I send
you the link:

http://www.codeproject.com/csharp/DataGridView_Drag-n-Drop.asp

If this don't works, just try the cached from google link

http://72.14.203.104/search?q=cache:djRIq1QsWRUJ:www.codeproject.com/csharp/DataGridView_Drag-n-Drop.asp+C%23+datagridview+drag+and+drop&hl=en&ct=clnk&cd=1

Good luck
Braulio

--
/// ------------------------------
/// Braulio Díez Colaborador DNM
///
/// http://www.dotnetmania.com
/// My Site (.net Tips): http://www.bdiez.com
/// ------------------------------




[quoted text, click to view]
cnickl
3/27/2006 11:28:03 AM
Thanks, but that was one of the first examples I looked at. The “acceptor” of
the Drop in this example is a ListBox, and they, like everywhere else, use
the IndexFromPoint method to get the index. So I can’t use it.

[quoted text, click to view]
cnickl
3/28/2006 7:17:04 AM
Problem solved. I used the HitTest method on the target Grid just the same
way I used it on the origin. Worked fine.

[quoted text, click to view]
AddThis Social Bookmark Button