Solved

DataGrid Drag and Drop

Posted on 2001-07-02
5
406 Views
Last Modified: 2010-10-05
I can't get DataGrid to accept drag and drop
from other sources (it turns into a not sign while over the DataGrid). I *can* get DataGrid to be
a drag and drop source, and I *can* get other controls on the same form as the DataGrid to accept drag and drop.

I am indeed setting AllowDrop to true for the DataGridTextBox, the DataGrid control, and the form on which it sits. I also have handlers for DragDrop, DragEnter, and DragOver.

Any ideas?

I appreciate any help anyone can give me.
0
Comment
Question by:ryanbeach
  • 3
5 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6261597
Neither could I. So I tried it another way. I used the DragEnter event to grab the data (which was plain text from the editor in this case):

Set the AllowDrop to true and add the following code:

protected void dataGrid1_DragEnter( .... )
{
    MessageBox.Show(e.Data.GetData("Text").ToString());
}


Regards,
CJ
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6261598
Using Beta 2
0
 
LVL 2

Expert Comment

by:preinsko
ID: 6264167
This is just a suggestion.  
We need to know the dev environment of the asker.
1. Beta 2 and VS
2. Beta 2 and premium asp
3. Beta 2 and sdk.
Sometimes it will be apparent; but sometimes it will not and there are different answers for each of the combinations.
 
Are we going crazy yet?

I would just like to make sure all the experts ask the question up front so there is no confusion.

It's just a suggestion.
0
 

Author Comment

by:ryanbeach
ID: 6266516
Using Visual Studio .Net Beta2 with updated
Beta2 components:

I can't get DataGrid to accept drag and drop
from other sources (it turns into a not sign while over the DataGrid). I *can* get DataGrid to be
a drag and drop source, and I *can* get other controls on the same form as the DataGrid to accept drag
and drop.

I am indeed setting AllowDrop to true for the DataGridTextBox, the DataGrid control, and the form on
which it sits. I also have handlers for DragDrop, DragEnter, and DragOver.

If I only handle external drags and drops, and not DataGrid-originated drags and drops, then I'm not able to do some of the very cool things I wanted to do with my application.

Any ideas?

I appreciate any help anyone can give me.
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 200 total points
ID: 6268338
Do it all manually..changing the cursor, using the mouseup event and some flags to set when the user is hovering over the datagrid with the dragenter.

Regards,
CJ
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
Resolve DNS query failed errors for Exchange
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question