Drag and Down

  • Thread starter Thread starter Benny
  • Start date Start date
B

Benny

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
 
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,
 
Back
Top