I have a datagrid with a dropdownlist in it. As I understand it, the
ItemTemplate section represents the cell when not in edit mode and the
EditItemTemplate section represents the cell when in edit mode. For
simplicity let's call ddl in ItemTemplate section "ddl1" and the ddl in the
EditItemTemplate section "ddl2".
I am trying to set the SelectedIndex value for the ddl's. When not in edit
mode I can set set an object to ddl1 with no problem. Here's how I do it:
MyDdlObject = CType(e.Item.Cells(1).FindControl("ddl1"), DropDownList)
When I try it with ddl2 I get Nothing.
MyDdlObject = CType(e.Item.Cells(1).FindControl("ddl2"), DropDownList)
How can I access this ddl that is in the EditItemTemplate section?
Thanks!