Solved

DataGrid Drag and Drop

Posted on 2001-07-02
5
399 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
Comment Utility
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
Comment Utility
Using Beta 2
0
 
LVL 2

Expert Comment

by:preinsko
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

10 Experts available now in Live!

Get 1:1 Help Now