Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net RadioButton visibility inside a RadioButtonList

Is there a way to hide radio buttons inside a RadioButtonList control programmatically?

like image 598
Mac Avatar asked Aug 28 '08 20:08

Mac


2 Answers

Under the hood, you can access the attributes of the item and assign it a CSS style.

So you should be able to then programmatically assign it by specifying:

RadioButtonList.Items(1).CssClass.Add("visibility", "hidden")

and get the job done.

like image 59
Dillie-O Avatar answered Oct 04 '22 21:10

Dillie-O


Here's how you have to apply a style attribute to a listitem:

RadioButtonList.Items(1).Attributes.Add("style", "display:none")
- OR -
RadioButtonList.Items(1).Attributes.Add("style", "visibility:hidden")

like image 21
Airn5475 Avatar answered Oct 04 '22 21:10

Airn5475