1 Replies - 2150 Views - Last Post: 14 May 2006 - 07:14 PM Rate Topic: -----

#1 dhruba.bandopad  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 30-March 06

QUERY: Adding more JS/DOM attributes to DataGrids

Posted 09 May 2006 - 03:58 AM

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?

Is This A Good Question/Topic? 0
  • +

Replies To: QUERY: Adding more JS/DOM attributes to DataGrids

#2 sontek  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 283
  • Joined: 13-September 01

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1