Shawn Bowman
Top achievements
Rank 1
Shawn Bowman
asked on 30 Oct 2009, 06:40 PM
Hello,
First off I want to thank you for the great tools and functionality that Telerik delivers.
Now on to my problem/question.
I am using the code from http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx to the tee except for the database it is pulling from. This demo allows you to drag and drop from the left table to the right table. I want to be able to drag and drop between the two grids.
How would I go about this functionality. I have read the forums quite extensively and haven't found a simple solution.
Any help would be greatly appreciated.
First off I want to thank you for the great tools and functionality that Telerik delivers.
Now on to my problem/question.
I am using the code from http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx to the tee except for the database it is pulling from. This demo allows you to drag and drop from the left table to the right table. I want to be able to drag and drop between the two grids.
How would I go about this functionality. I have read the forums quite extensively and haven't found a simple solution.
Any help would be greatly appreciated.
9 Answers, 1 is accepted
0
Schlurk
Top achievements
Rank 2
answered on 30 Oct 2009, 09:17 PM
If you scroll down to this piece of code in the .cs file:
You can see that it is specifically checking for the OnwnerGridID of the PendingOrders grid. Now I haven't tried this out myself but I imagine you could set up an a similar if condition for going the reverse way, which would allow you to customize the behavior for each dragging interaction.
| protected void grdPendingOrders_RowDrop(object sender, GridDragDropEventArgs e) |
| { |
| if (string.IsNullOrEmpty(e.HtmlElement)) |
| { |
| if (e.DraggedItems[0].OwnerGridID == grdPendingOrders.ClientID) |
| { |
| .... |
| } |
| } |
| .... |
| } |
You can see that it is specifically checking for the OnwnerGridID of the PendingOrders grid. Now I haven't tried this out myself but I imagine you could set up an a similar if condition for going the reverse way, which would allow you to customize the behavior for each dragging interaction.
0
Shawn Bowman
Top achievements
Rank 1
answered on 02 Nov 2009, 04:32 PM
I'll try adding a new If statement for going the opposite way and seeing if I can get it to work. I tried it previously without any luck, but it may have been a simple mistake. I'll go through and see what I can accomplish. Any suggestions from anyone would be greatly appreciated.
0
Shawn Bowman
Top achievements
Rank 1
answered on 02 Nov 2009, 04:56 PM
Ok it has proved a bit more difficult. It would appear I need to edit the js also in order for this to work I believe. To replicate what I did, this is what I have done.
I edited the Protected Sub for the grdShippedOrders_RowDrop and simply pasted the code from the grdPendingOrders_RowDrop and swapped the areas saying Pending to shipped. My only question is would small javascript at the top of the aspx page need to be changed also, and if so what would need to be added?
I edited the Protected Sub for the grdShippedOrders_RowDrop and simply pasted the code from the grdPendingOrders_RowDrop and swapped the areas saying Pending to shipped. My only question is would small javascript at the top of the aspx page need to be changed also, and if so what would need to be added?
0
Hello Shawn,
Attached you will find a working sample which displays the drag-and-drop feature between two RadGrids. It was based off of the Drag-and-Drop Demo. In order to get this kind of functionality you have to re-write the grdShippedOrders_RowDrop event to mimic the grdPendingOrders_RowDrop so it can handle dropping a row from Shipped to Pending. The OnRowDropping client-event can also be removed from the client settings since it actually cancels a row drop onto grdPendingOrders.
All the best,
Carl
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.
Attached you will find a working sample which displays the drag-and-drop feature between two RadGrids. It was based off of the Drag-and-Drop Demo. In order to get this kind of functionality you have to re-write the grdShippedOrders_RowDrop event to mimic the grdPendingOrders_RowDrop so it can handle dropping a row from Shipped to Pending. The OnRowDropping client-event can also be removed from the client settings since it actually cancels a row drop onto grdPendingOrders.
All the best,
Carl
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.
0
Shawn Bowman
Top achievements
Rank 1
answered on 05 Nov 2009, 09:10 PM
I am using an older version of the Telerik Tools. I am using version 2008.1.619 and I am also a vb shop here. I did attempt to convert it over and got it all fixed except a few issues with DropPosition and GridItemDropPosition and DestinationTableView. I am guess these are newer the newer grid control options.
I appreciate your help and apologize for being difficult.
I appreciate your help and apologize for being difficult.
0
Schlurk
Top achievements
Rank 2
answered on 05 Nov 2009, 11:19 PM
Does the original demo work on your machine? I'm not too familiar with the 2008 Q1 release so I don't really know the differences between that version and what Carl posted so I just want to see if there are equivalent objects to these in your version.
0
Shawn Bowman
Top achievements
Rank 1
answered on 06 Nov 2009, 05:22 PM
I had to make a few minor adjustments to make them work. The main issue is that the older tools don't have the DropPosition at least as far as I can tell. I see DropPosition on the TreeView, but not in the RadGrid.
The demo that was sent to me using drag and drop between the two grids won't function, mostly because of three things.
DropPosition
GridItemDropPosition
DestinationTableView
I believe those will not work in the old 2008 tools. Otherwise the demo on the site worked alright after a few minor tweaks as I believe those items were not in it.
The demo that was sent to me using drag and drop between the two grids won't function, mostly because of three things.
DropPosition
GridItemDropPosition
DestinationTableView
I believe those will not work in the old 2008 tools. Otherwise the demo on the site worked alright after a few minor tweaks as I believe those items were not in it.
0
Shawn Bowman
Top achievements
Rank 1
answered on 10 Nov 2009, 09:47 PM
Can anyone help me with this? I am up a creek without a paddle so to speak. I am unable to get this to work with the 2008 controls after trying several approaches.
Any help would be greatly appreciated.
Any help would be greatly appreciated.
0
Hi Shawn,
Attached you will find a sample built upon the 2008.1.619 version of our controls written in VB.NET. When you are moving items from the Shipped Grid to the Pending Grid and vice versa please note that these items are added to the end of the item list, as this version of our controls is not able to keep track of the position where you dropped the items.
Sincerely yours,
Carl
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.
Attached you will find a sample built upon the 2008.1.619 version of our controls written in VB.NET. When you are moving items from the Shipped Grid to the Pending Grid and vice versa please note that these items are added to the end of the item list, as this version of our controls is not able to keep track of the position where you dropped the items.
Sincerely yours,
Carl
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.