This is a migrated thread and some comments may be shown as answers.

[Solved] Drag&Drop file from desktop on RadGridView

3 Answers 181 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andreas
Top achievements
Rank 1
Andreas asked on 14 Sep 2010, 04:00 PM
Hi,

I want to drag a file from the desktop onto a RadGridView and then upload it when it is dropped on certain grid row. By setting AllowDrop=True I managed to react on the Drop event of the RadGridView. But now I am stuck. I tried to get the dropped File by using

private void gridDocuments_Drop(object sender, DragEventArgs e)
{
  FileInfo file = e.Data.GetData(typeof(FileInfo)) as FileInfo;
}

but I get a NotImplementedException.

So could please someone help me with the following questions:
1) how can I start the upload e.g. with a RadUpload?
2) I want that the row over which the mouse holds the currently dragged item to be highlighted. Do I have to implement this on my own or is there a way to force RadGridView to do so?

Thanks in advance and best regards,
Stefan

3 Answers, 1 is accepted

Sort by
0
Andreas
Top achievements
Rank 1
answered on 16 Sep 2010, 01:31 PM
Hello,

I found an answer to my first question in the following thread:
http://www.telerik.com/community/forums/silverlight/richtextbox/moving-image.aspx.

Still I would appreciate an answer to my second question. Does anybody know, how a row of a RadGridView is highlighted but not selected on DragEnter and set back to normal on DragLeave? I would like to have the same behaviour for DragOver as for MouseOver.

Thanks for your help,
Stefan
0
Accepted
Tsvyatko
Telerik team
answered on 17 Sep 2010, 08:43 AM
Hello Stefan,

You can highlight the  desired row using the IsMouseOver property. To force the row to update its state OnApplyTemplate call is required.
row.IsMouseOver = true;
 
row.OnApplyTemplate();

Currently, we are working to improve this, so that no additional calls are required. Please, give it a try and let me know if you have further questions.

Regards,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 20 Sep 2010, 10:17 AM
Hello Tsvyatko,

thanks for your help. It works!

Kind wishes,
Stefan
Tags
GridView
Asked by
Andreas
Top achievements
Rank 1
Answers by
Andreas
Top achievements
Rank 1
Tsvyatko
Telerik team
Share this question
or