Not finding a solution in a Tek-Tip Search I came up with a simple solution for capturing values form any row, column selected in a Datagrid using javascript. Microsoft recommends an x,y coordinate obj recognition routine but I found the dd list wouldn't behave. This solution is as follows:
The datagrid has a dropdownlist (id="ddOrder") with the following attribute added during the ItemDataBound event:
The dropdownlist occurs in the last column ([3]). A person selects a number (1-10) in the ddl and triggers the following javascript:
In this way you capture the selected values from other columns using javascript. The orginal solution was found on Goggle Groups. Hopefully this post will pop-up in future searches. Any advantages/disadvantage might be noted.
The datagrid has a dropdownlist (id="ddOrder") with the following attribute added during the ItemDataBound event:
Code:
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
..
CType(e.Item.FindControl("ddOrder"), DropDownList).attributes.add("OnChange","javascript:tabInvoice(this.value)")
..
End If
The dropdownlist occurs in the last column ([3]). A person selects a number (1-10) in the ddl and triggers the following javascript:
Code:
function tabInvoice(val){
var el = document.getElementById("dgOrders");
var ver = el.rows[val].cells[2].innerText;
text1.value = ver + ', ' + val;
In this way you capture the selected values from other columns using javascript. The orginal solution was found on Goggle Groups. Hopefully this post will pop-up in future searches. Any advantages/disadvantage might be noted.