scm0sml
asked on
hiding a listitem of my radiobuttonlist
I have the radio list below.
Basically based on a check inside an if statement i want to able to hide the fourth element, so the user would not see the "Uses Supplier Setup" option.
How can I go about doing that in the code behind?
Basically based on a check inside an if statement i want to able to hide the fourth element, so the user would not see the "Uses Supplier Setup" option.
How can I go about doing that in the code behind?
<asp:radiobuttonlist id="rblAccountDueDate" runat="server" repeatdirection="horizontal">
<asp:ListItem value="1">Departure</asp:ListItem>
<asp:ListItem Value="2">Booking</asp:ListItem>
<asp:ListItem Value="3">Component Start Date</asp:ListItem>
<asp:ListItem value="0">Uses Supplier Setup</asp:ListItem>
</asp:radiobuttonlist>
ASKER
i get the intellisense to do this:
rblAccountDueDate.Items[4] .Visible
but doesnt like me setting the value of false, i get:
Property access must assign to the property or use its value.
rblAccountDueDate.Items[4]
but doesnt like me setting the value of false, i get:
Property access must assign to the property or use its value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hint: Be careful, refresh the page a few times and make sure those items aren't added every time the page loads if it's an automatic reload caused by the ASP controls on the website (ie, if one of the controls has an event, asp will cause the page to reload automatically). You might end up with the list growing every time that happens.
rblAccountDueDate.Items[4]