I know that Javascript lets us add:
ondragenter, ondragover, ondragleave, ondrop
events to normal HTML table td tags. This lets us do highlighting of
table cells/rows, and capture drag & drop events. So to handle
ondrop we can use java script:
this.ondrop = function(obj) {
obj.parentElement.style.backgroundColor = "white";
var strData = window.event.dataTransfer.getData("text");
this.InsertRow(obj.parentElement.rowIndex, strData);
window.event.cancelBubble = true;
}
The obj is the object that was dropped onto. So obj.parentElement is
the tr element, etc. Does all tr elements implicitly have a rowIndex
member which contains the row number of the table?
What am wondering is how can one add the ondrop="" attribute to a
table which was generated from a DataGrid? If it is not possible
adding Javascript/DOM attributes to DataGrid's generated tables, then
is there any way to capture these window.events and knowing exactly
which DataGrid table row/cell it was dragged onto?
I was told to look for "DataGrid Overviews" at 4guysfromrolla.com but
could not find anything about it. Not even google.com could help. Is
there no drag and dropping support for ASP.NET datasource tables?
1 Replies - 2061 Views - Last Post: 14 May 2006 - 07:14 PM
Replies To: QUERY: Adding more JS/DOM attributes to DataGrids
#2
Re: QUERY: Adding more JS/DOM attributes to DataGrids
Posted 14 May 2006 - 07:14 PM
You could probably use the ClientScript object to do it all for you,
Here is a basic tutorial on how to use it:
http://www.west-wind...leCallBack.aspx
Here is a basic tutorial on how to use it:
http://www.west-wind...leCallBack.aspx
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|