Hi,
I try drag & drop function from gridview1 to gridview2 in wpf application. but i don't know
please help me..
Thanks.
16 Answers, 1 is accepted
One of our customers has already done that. He has posted the code of his drag and drop application here - http://www.telerik.com/community/forums/silverlight/gridview/gridview-draganddrop-selection-problem.aspx
For your convenience I have used Pablo's code to create a solution that you can easily run - you can find it attached to my reply.
Best wishes,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks for your help, but I have a question.
I know that namespace(Telerik.Windows.Controls.DragDrop) does not exist in WPF.
Is this sample execution possible even at WPF?
I execute project in wpf.
Excuse me for sending you the SL drag/drop. The RadGragDropManager is not available for WPF so currently there is no straightforward way of moving rows from one grid to the other. Nevertheless I have created one class called GridDragDrop that implements this functionality.
You just have to create an instance of the GridDragDrop class and pass it references to two grids. Whenever the user drags a row from one of the grids and drops it on the other the RowDropped event will ve raised, giving you the freedom to remove the row form the first grid and add it to the second one.
I am sending you a project that demonstrates the GridDragDrop class.
Hope this helps.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks,
Billy Jacobs
Hello Billy Jacobs,
I'd love to send you a new sample since the one that I have posted here is a bit outdated and now I will be able to get a better result with fewer lines of code.
I would really appreciate it if you could share some more information about your scenario so that I do not miss some important detail that might be crucial for your scenario. Some questions that come to my mind are: Is hierarchy used for both source and target grids? What kind of hierarchy is used (Property hierarchy, self-referencing, etc).
Best wishes,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Let me know if you need more detail.
Thanks,
Billy Jacobs
Excuse me for the delay. The sample will be ready tomorrow.
Kind regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Here is the sample that I have promised. The sample application contains one class called GridDragDrop which enables the drag and drop between two grids. The sample application demonstrates how this class can be used.
I hope this will be helpful.
Once again I am really sorry for the delay.
All the best,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I using a simple flat collection. I have two grids and need Drag&drop from "Grid #1" to "Grid #2" grid (with insert, so I can drop anywhere on the grid) and drag&drop within the "Grid #2" so I can change position on items. No need to drag&drop from "Grid #2" to "Grid #1" grid.
/Ken
*** SOLVED ***
I will be posting a a blog post on to that topic soon. I will try to do it tomorrow and notify you when the post is public. You will be able to enable the row reorder functionality that with just a few lines of XAML code.
Sincerely yours,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks for the sample code on the drag and drop. It worked perfectly until I upgraded to Q3 and now I get build errors with the dragdrop objects. I can send you the specific errors if you need but it looks like you are aware of this issue.
Could you update the sample to work for Q3?
Thanks,
Billy Jacobs
I will post the updated sample tomorrow.
Sincerely yours,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Here is the updated version of the project that works with Q3.
Sincerely yours,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
The error is when it is trying to capture the mouse rectangle within the telerik framework.
I have Q3 SP2.
I am forced to downgrade to the Q2 sample where it works.
Thanks,
Billy Jacobs
Please, refer to these two articles - Enable Row Reordering within two RadGridView-s and Drag and Drop within RadGridView. They provide extensive information on how to accomplish this task. You can check this online demo as well (you can find the same example in your local copy of WPF demos).
Yoan
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>