Sqsadzyozexrw
New Member
According to a specific row value (Type), I must use a TextBox or a DropDownlist inside an EditTemplateField (only ONE of them).How can I bind conditionally controls inside the EditItemTemplate in order to tell the UpdateMethod which is the control to take into consideration for the field "Value"?\[code\]<asp:TemplateField> <ItemTemplate> <asp:Label ID="LabelType" runat="server" Text='<%# Eval("Type") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="LabelType" runat="server" Text='<%# Eval("Type") %>'></asp:Label> </EditItemTemplate></asp:TemplateField><asp:TemplateField > <ItemTemplate> <asp:Label ID="LabelValue" runat="server" Text='<%# Eval("Value") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <div style="text-align:center"> <asp:TextBox ID="TextBoxValue" runat="server" Text='<%# Bind("Value") %>'></asp:TextBox> <aspropDownList ID="DropDownListValue" runat="server" SelectedValue='http://stackoverflow.com/questions/12742932/<%# Bind("Value") %>'> </aspropDownList> </div> </EditItemTemplate></asp:TemplateField>\[/code\]