gridview findcontrol in footer problem

Posted by harold-sota on Stack Overflow See other posts from Stack Overflow or by harold-sota
Published on 2010-04-27T09:13:52Z Indexed on 2010/04/27 9:23 UTC
Read the original article Hit count: 303

Filed under:
|
|
|

I have a asp.net grid view with the property ShowFooter="True" and a item template as

                            <FooterTemplate>
                               <asp:DropDownList  ID="Contetnt1InsertDropDownList"  Width="100%" runat="server" DataSource="<%# GetValueForDropDownCombinationContent() %>"  
                                   DataValueField="LOOKUP_ID"  DataTextField="LOOKUP_NAME" >
                                </asp:DropDownList>
                           </FooterTemplate>

in the code behind :

Dim ddl As DropDownList = DirectCast(combinationViewGridView.FooterRow.FindControl("Loocup1InsertDropDownList"), DropDownList)

in a RowCommand event the cast return a null value.

Any ideas??

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about gridview