access drop down list on details view
-
Ive been trying to find a way to access a drop down list value that is within the item template in a details view. This drop down list is conected to a database and i want to recover the value that is loaded when the page loads. So can anyone help me with some clues on how to go about this??
-
Ive been trying to find a way to access a drop down list value that is within the item template in a details view. This drop down list is conected to a database and i want to recover the value that is loaded when the page loads. So can anyone help me with some clues on how to go about this??
Do this: DropDownList ddl = (DropDownList)dtv.Rows[index].FindControl("ddlTemplate"); ddl gets the reference to the dropdown in the item template, i.e ddlTemplate. Let me know how it goes.
-
Do this: DropDownList ddl = (DropDownList)dtv.Rows[index].FindControl("ddlTemplate"); ddl gets the reference to the dropdown in the item template, i.e ddlTemplate. Let me know how it goes.
-
yeah thanks that worked like a charm :) now i get that find control returns the controls reference.
Glad that worked for you :)