When I perform a radiobuttonclick, I want to set a dropdownlist to become visible. The radiobutton and dropdownlist are within the same datagrid. I am not sure how to do this.
<asp:UpdatePanel ID="updatepanel" UpdateMode="conditional" runat="server">
<ContentTemplate>
<asp:DataGrid ID="DataGrid" AutoGenerateColumns = "false" CssClass="objectSubTitle" ItemStyle-Wrap="true" runat="server" OnItemCommand="handler" ><Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:RadioButton ID ="RadioButton1" Text="Yes" GroupName="creatingNewCard" OnCheckedChanged="RadioButtonYes" AutoPostBack="True" runat="server" />
<asp:DropDownList ID="DropDownList1" Visible="false" runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
Assuming that they are in an
ItemTemplateof aTemplateFieldand you want to switch vivibility on serverside:Sample-GridView:
Edit: as you’ve edited your question to show that you really use a
DataGridinstead of aGridView, the code is similar: