Having trouble w/TemplateColumn w/Dropdown having trouble

James

Well-known member
Joined
Oct 3, 2002
Messages
78
I have a problem. I have a datagrid that I want to edit. When I press the edit link, the first column dropdown list populates fine. I dont know how to get my dropdown list to default to the value that was in the cell before the edit link was pressed.
Ive played with the OnDataBinding event on the dropdown but have not been successful. I tried to use the Findcontrol method to find the dropdown id but my code does not see it. If I can access the properties and methods of the dropdown I can use a loop until I find a match and use the selectindex= assignment. I have another column with the same data that is hidden. in the procedure that is call when the edit link is clicked I use this column to assign a session variable the value that I want the dropdown to defautl to.Can someone point me in the right direction.

James
 
To find your dropdownlist you can use:

Code:
For i = 0 To dgCartContent.Items.Count - 1
    Dim ddlQuantity As DropDownList = CType(dgCartContent.Items(i).FindControl("quantity"), DropDownList)


John
 
Back
Top