Solved

DataGrid Drag and Drop

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Downtime reduced, data recovered by utilizing an Experts Exchange Business Account Challenge The United States Marine Corps employs more than 200,000 active-duty Marines with operations in four continents, all requiring complex networking system…
Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 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