Solved

DataGrid Drag and Drop

Posted on 2001-07-02
5
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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