Solved

DataGrid Drag and Drop

Posted on 2001-07-02
5
403 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now