I created a row (header row) in a gridview with a dropdownlist among other input controls. I also put a button on that row (fltbttn-see below). I created an addhandler for the button called fltbttn_Click. I want gain access to my dropdownlist (ddlscantype) using findcontrol but how can I get to the header row where the filter controls exist?
Dim fltbttn As New ImageButton
fltbttn.ImageUrl = "\images\bttnFilter.gif"
AddHandler fltbttn.Click, AddressOf fltbttn_Click
Dim cell As New TableCell
Dim row As New GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal)
Dim ddlscantype As New DropDownList
AddHandler ddlscantype.SelectedIndexChanged, AddressOf ddlscantype_Changed
ddlscantype.DataSource = SqlDataSource2
ddlscantype.DataValueField = "value"
ddlscantype.DataTextField = "name"
ddlscantype.DataBind()
row.Cells.Add(cell)
cell.Controls.Add(ddlscantype)
MARKUP
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate >
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1" Font-Names="Estrangelo Edessa" Font-Size="Small"
ShowFooter="True"
Caption = '<table border="" width="100%" cellpadding="3" cellspacing="0" bgcolor="#4A3C8C"><tr><td style = "font-size:X-large;font-family:Arial CE;color:White"><b>Receiving Error Log</u></td></tr></table>' >
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<Columns>
<asp:BoundField DataField="scan" HeaderText="Scan" SortExpression="scan" />
<asp:BoundField DataField="ScanType" HeaderText="ScanType" ReadOnly="True"
SortExpression="ScanType" />
<asp:BoundField DataField="Vendor" HeaderText="ht" ReadOnly="True"
SortExpression="ht" />
<asp:BoundField DataField="Name" HeaderText="ht2" ReadOnly="True"
SortExpression="ht2" />
</Columns>
//footer style and pager style blah blah blah goes here.
</ContentTemplate>
</asp:UpdatePanel>
<ajaxToolkit:UpdatePanelAnimationExtender ID="upae" BehaviorID ="animation" runat="server" TargetControlID = "UpdatePanel1" >
<Animations >
<OnUpdating>
<Parallel duration="0">
<ScriptAction Script="onUpdating();" />
</Parallel>
</OnUpdating>
<OnUpdated>
<Parallel duration="0">
<ScriptAction Script="onUpdated();" />
</Parallel>
</OnUpdated>
</Animations>