Groups | Blog | Home
all groups > c# > may 2004 >

c# : Drag and Down


Benny
5/13/2004 11:47:17 PM
Hello Experts,

Currently I am working on a windows-based project using asp.net with C#.

One of the project tasks is to create a scheduler. For example I have
two datagrids with one rows each: dgA and dgB. On dgA, each column
display a customer name; on dgB, each column is a date (i.e. 1st, 2nd,
3rd, 4th...). Now what I need to do is drop a customer name from dgA to
any date in dgB.

Question: how can I drag and drop objects btween two datagrids?


Thank you in advanced,

Benny

*** Sent via Developersdex http://www.developersdex.com ***
APG
5/14/2004 4:44:36 PM
Hi Benny,

1. In dgA,
a. you can use the MouseDown event and the HitTest method of the
DataGrid to identify the row that is clicked.
b. Initiate a drag-and-drop operation using the DoDragDrop method.

2. In dgB,
a. Handle the Drag events, viz., DragDrop, DragEnter, DragLeave,
DragOver, to get the details of the dropped row and handle it appropriately.

Hope this gives you some outline.

HTH,
APG
[quoted text, click to view]
Benny
5/16/2004 3:17:23 PM
Hi APG,

Do you know any examples of D&D I can reference to?


Thanks,

Benny

*** Sent via Developersdex http://www.developersdex.com ***
APG
5/20/2004 7:44:15 PM
Hi Benny,

I am not sure of this late reply helps. However, here is a helpful
snippet in George Shepherd's FAQs:

http://www.syncfusion.com/FAQ/WinForms/FAQ_c91c.asp#q617q

HTH,
APG

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