Posted on: 12/15/2014 3:05:41 PM | Views : 800

Hi,
I have a GridView and a TemplateField with a dropdownlist which I tried to bound the value manually. In "OnRowDataBound", I tried to find the label in that same TemplateField by using "FindControl", but it return null. As a result, the ddlRelation dropdown didn't bound to anything. Is there anything missing? Please see the code below:
<asp:GridView ID="GridView2" runat="server" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" onrowcancelingedit="GridView2_RowCancelingEdit" onrowdeleting="GridView2_RowDeleting" onrowediting="GridView2_RowEditing" OnRowDataBound="OnRowDataBound" onrowupdating="GridView2_RowUpdating" > /> <Columns>
<asp:TemplateField HeaderText="Relation"> <ItemTemplate> <asp:Label ID="lblRelation" runat ...

Go to the complete details ...