Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2006

Tip: Looking for answers? Try searching our database.

Drag and Drop with DataGridView

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cnickl - 27 Mar 2006 06:27 GMT
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
use to get the target index?
Braulio Diez - 27 Mar 2006 10:59 GMT
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/Data
GridView_Drag-n-Drop.asp+C%23+datagridview+drag+and+drop&hl=en&ct=clnk&cd=1


  Good luck
           Braulio

Signature

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

> 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
> use to get the target index?
cnickl - 27 Mar 2006 20:28 GMT
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.

> Hello,
>
[quoted text clipped - 16 lines]
> > target index. Is there any code example or does anyone know what method to
> > use to get the target index?
cnickl - 28 Mar 2006 16:17 GMT
Problem solved. I used the HitTest method on the target Grid just the same
way I used it on the origin. Worked fine.

> Hello,
>
[quoted text clipped - 16 lines]
> > target index. Is there any code example or does anyone know what method to
> > use to get the target index?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.