Hello,
I am using a template form on which I have a dropdown list. Depending on the selection, I need to hide or show a couple of different labels/date pickers. While I can access the dropdown list using the SelectedIndexChanged as follows, can you please help me figure out how I can show/hide the controls? I have found similar questions asked before but have yet to found a clear response. Really appreciate your help as I've put in quite a bit of time figuring this out.
protected void ddDuration_SelectedIndexChanged(object sender, DropDownListEventArgs e)
{
RadDropDownList ddDuration = (RadDropDownList)sender;
sDuration = (string)ddDuration.SelectedValue;
if (sDuration == "0")
{
//Need to show lblStartTime and timeStart, and Hide lblFullDate. dateFull
}
else
{
//Need to show lblFullDate, dateFull and Hide lblStartTime and timeStart.
}
}
<telerik:RadDropDownList Width="16.8em" ID="ddDuration" runat="server" OnSelectedIndexChanged="ddDuration_SelectedIndexChanged"
AutoPostBack="true">
<Items>
<telerik:DropDownListItem Text="Please Select" Value="">
</telerik:DropDownListItem>
<telerik:DropDownListItem Text="Partial" Value="0">
</telerik:DropDownListItem>
<telerik:DropDownListItem Text="Full Day" Value="1">
</telerik:DropDownListItem>
</Items>
</telerik:RadDropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label Font-Bold="true" ID="lblFullDate" runat="server"
Text="FullDay Closure Date: "></asp:Label>
</td>
<td>
<telerik:RadDatePicker ID="dateFull" runat="server" RenderMode="Classic"></telerik:RadDatePicker>
</td>
</tr>
<tr>
<td>
<asp:Label Font-Bold="true" ID="lblStartTime" runat="server"
Text="Partial Closure Start Time: "></asp:Label></td>
<td>
<telerik:RadDateTimePicker Width="21.2em" RenderMode="Classic"
runat="server" ID="timeStart"></telerik:RadDateTimePicker>
</td>
</tr>