I'm working with the Item Drag and Drop sample, and it works very well. However, I have modified it slightly. The source datagrid has a different number of columns than the destination datagrid. I have modified the code so that when the item is dropped, I manually add the row to the grid. That all works fine, but I really would like to know which column the item was dropped on. Is there a way to get this information?
Thanks,
Derrick.
Thanks,
Derrick.
10 Answers, 1 is accepted
0
Hello Derrick,
I'm afraid the this scenario is not supported out-of-the-box. However this can be accomplished with few lines of javascript. You should hook to client-side onRowDropping event and retrieve the column's uniqueName. Similar to this:
Let us know if this help or you need further assistance.
All the best,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I'm afraid the this scenario is not supported out-of-the-box. However this can be accomplished with few lines of javascript. You should hook to client-side onRowDropping event and retrieve the column's uniqueName. Similar to this:
function onRowDropping(sender, args) |
{ |
//get the first row element |
var row = Telerik.Web.UI.Grid.GetFirstParentByTagName(args.get_destinationHtmlElement(), "tr"); |
//check if the row element is gridDataItem and if the destination element is a tablecell |
if(!row || row.id == "" || args.get_destinationHtmlElement().tagName.toLowerCase() != "td") |
return; |
//retrieve the GridTableView's object |
var tableID = row.id.split("__")[0]; |
var tableView = $find(tableID); |
//get the cell's uniqueName |
alert(tableView.getColumnUniqueNameByCellIndex(tableView.HeaderRow, args.get_destinationHtmlElement().cellIndex)); |
} |
Let us know if this help or you need further assistance.
All the best,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Derrick
Top achievements
Rank 1
answered on 08 Oct 2008, 11:52 PM
Rosen,
Thanks for your response. I tried the javascript you provided, and it works well. However, is it possible to get this information on the server-side?
Thanks,
Derrick.
Thanks for your response. I tried the javascript you provided, and it works well. However, is it possible to get this information on the server-side?
Thanks,
Derrick.
0
Accepted
Hi Derrick,
You can try saving the column's UniqueName inside a hidden field and then retrieve is on the server.
All the best,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You can try saving the column's UniqueName inside a hidden field and then retrieve is on the server.
All the best,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Derrick
Top achievements
Rank 1
answered on 10 Oct 2008, 12:29 AM
Thank you very much! That works great!
0

Feizal Amlani
Top achievements
Rank 1
answered on 13 Nov 2008, 01:22 AM
Hello,
I am using the Grid's client-side method "GetFirstParentByTagName" and it works great. I am looking for similar methods to traverse the Grid. However, I cannot find any documentation on the available methods. Where is "GetFirstParentByTagName" in your documentation of the Grid.
Thanks.
I am using the Grid's client-side method "GetFirstParentByTagName" and it works great. I am looking for similar methods to traverse the Grid. However, I cannot find any documentation on the available methods. Where is "GetFirstParentByTagName" in your documentation of the Grid.
Thanks.
0
Hello Feizal,
There is not any detailed documentation on this method, but the sample posted earlier demonstrates its usage.
Additionally, I will make sure there is additional information added about this method.
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
There is not any detailed documentation on this method, but the sample posted earlier demonstrates its usage.
Additionally, I will make sure there is additional information added about this method.
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Feizal Amlani
Top achievements
Rank 1
answered on 13 Nov 2008, 02:14 PM
Thanks for the information. I am wondering if there are any other methods similar to "Telerik.Web.UI.Grid.GetFirstParentByTagName". Specifically, what I want to do is have a command button at the top of the grid and find all children of the grid with a specified tag.
Thank You.
Thank You.
0
Hello Feizal,
Presently, there is no such method available.
You can use pure JavaScript, to iterate through the elements for any tag - parent or child, or the elements on the page.
Regards,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Presently, there is no such method available.
You can use pure JavaScript, to iterate through the elements for any tag - parent or child, or the elements on the page.
Regards,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Krushna
Top achievements
Rank 1
answered on 23 Feb 2011, 06:49 AM
Hi Yavor (Telerik team),
I would like to develop planner control - windows application (Desktop App) and it would be develop in .NET - C#. We would like to use datagrid (don't want to use silverligh and wpf etc) where we can able to drag and drop particular cell from one row to another row and rest of the data move left to right so please guide me that which control need to purchase and is it possible with telerik control. Please provide answer as soon as possible.
Thanks,
Krushna
I would like to develop planner control - windows application (Desktop App) and it would be develop in .NET - C#. We would like to use datagrid (don't want to use silverligh and wpf etc) where we can able to drag and drop particular cell from one row to another row and rest of the data move left to right so please guide me that which control need to purchase and is it possible with telerik control. Please provide answer as soon as possible.
Thanks,
Krushna
0
Hi Feizal Amlani,
Thank you for your interest.
I would suggest that you try our RadScheduler control that can fit in your scenario. In addition, our RadGridView control supports drag & drop, please consider the GridView >> Rows >> Rows Drag & Drop example in our demo application. Please elaborate a bit more and describe in detail your scenario. This will help me to be more accurate in my suggestions.
I am looking forward to your reply.
All the best,
Jack
the Telerik team
Thank you for your interest.
I would suggest that you try our RadScheduler control that can fit in your scenario. In addition, our RadGridView control supports drag & drop, please consider the GridView >> Rows >> Rows Drag & Drop example in our demo application. Please elaborate a bit more and describe in detail your scenario. This will help me to be more accurate in my suggestions.
I am looking forward to your reply.
All the best,
Jack
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!