April 4th, 2003, 05:44 PM
#1
Drag & Drop on DataGrid Not Working
I have AllowDragDrop set to TRUE on DataGrid1 and DataGrid2.
Here is my code..
private void dataGrid1 _DragLeave(object sender, System.EventArgs e)
{
string strText = "Testing";
dataGrid1.DoDragDrop(strText, DragDropEffects.Copy) ;
}
private void dataGrid2 _DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
string strText = e.Data.GetData(DataFormats.Text).ToString();
MessageBox.Show(strText);
}
I'm trying to do a grad test to pass the word "Testing". When I drag an item from datagrid1 to datagrid2, nothing happens. Any idea what is going on?
Thank you!
- Adrian
April 7th, 2003, 11:33 AM
#2
AMON,
when you drag text does it comes in
dataGrid2_DragDrop method atleast.
-Paresh
- Software Architect
April 7th, 2003, 04:33 PM
#3
Hi Pareshgh,
No, not even the dataGrid2_DragDrop method. There are no visible signs on dataGrid1 or dataGrid2 that drag and drop is working.
I also tried changing the ReadOnly attribute on the dataGrids, but the same happens.
Any suggestions?
Thanks you,
- Adrian
April 7th, 2003, 04:42 PM
#4
Hi,
I have attached the source code project for Datagrid Text drag and drop.
you can have a look and check it out.
hope this helps
Paresh
Attached Files
- Software Architect
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width