Hi,
In my page I have a GridView in which I have an Item Template with a label and Edit Template with a DropDownList. Something like this:
<asp:GridView ID="MyGridView" runat="server" OnPageIndexChanging="MyGridView_PageIndexChanging" DataKeyNames="Id" OnRowEditing="MyGridView_RowEditing">
<Columns>
<asp:TemplateField HeaderText="Use" ItemStyle-Width="140px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="UseLabel" runat="server" Text='<%#Eval("ImageUse")%>' />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="UseDropDownList" runat="server" OnDataBinding="UseDropDownList_DataBinding" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
However, in the method UseDropDownList_DataBinding the line
Dim UseDropDownList As DropDownList = ExclusiveHistoryGridView.FindControl("UseDropDownList")
always result nothing. With this, I can't Bind the DropDownList because it's not being found. How do I bind it then?
Thanks in advance for all replies!
Ana