<p>Is there a way to hide radio buttons inside a RadioButtonList control programmatically?</p>

[{'answer_id': 33353, 'author': 'Zack Peterson', 'author_id': 83, 'author_profile': 'https://Stackoverflow.com/users/83', 'pm_score': 0, 'selected': False, 'text': '<p>If you mean with JavaScript, and if I remember correctly, you\'ve got to dig out the ClientID properties of each &lt;input type="radio" ...&gt; tag.</p>\n'}, {'answer_id': 33357, 'author': 'RedWolves', 'author_id': 648, 'author_profile': 'https://Stackoverflow.com/users/648', 'pm_score': 0, 'selected': False, 'text': '<p>Have you tried to hide it through the itemdatabound event onload or do you need it to hide after it loads?</p>\n'}, {'answer_id': 33365, 'author': 'Dillie-O', 'author_id': 71, 'author_profile': 'https://Stackoverflow.com/users/71', 'pm_score': 4, 'selected': True, 'text': '<p>Under the hood, you can access the attributes of the item and assign it a CSS style.</p>\n\n<p>So you should be able to then programmatically assign it by specifying:</p>\n\n<pre><code>RadioButtonList.Items(1).CssClass.Add("visibility", "hidden")\n</code></pre>\n\n<p>and get the job done.</p>\n'}, {'answer_id': 33371, 'author': 'James Hall', 'author_id': 514, 'author_profile': 'https://Stackoverflow.com/users/514', 'pm_score': 0, 'selected': False, 'text': '<p>I haven\'t tested it, but I\'d assume (for C#)</p>\n\n<pre><code>foreach(ListItem myItem in rbl.Items)\n{\nif(whatever condition)\nmyItem.Attributes.Add("visibility","hidden");\n\n}\n</code></pre>\n'}, {'answer_id': 319114, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>Why not add and remove the radio buttons as needed?</p>\n\n<pre><code>RadioButtonList.Items.Add("Item Name" or index);\nRadioButtonList.Items.Remove("Item Name" or index);\n</code></pre>\n'}, {'answer_id': 1594238, 'author': 'BlueGreenWorld', 'author_id': 193072, 'author_profile': 'https://Stackoverflow.com/users/193072', 'pm_score': 1, 'selected': False, 'text': '<p>Try This:</p>\n\n<pre><code>RadioButtonList.Items.Remove(RadioButtonList.Items.FindByValue("3"));\n</code></pre>\n'}, {'answer_id': 12178048, 'author': 'Airn5475', 'author_id': 229897, 'author_profile': 'https://Stackoverflow.com/users/229897', 'pm_score': 2, 'selected': False, 'text': '<p>Here\'s how you have to apply a style attribute to a listitem:</p>\n\n<p><code>RadioButtonList.Items(1).Attributes.Add("style", "display:none")</code><br>\n- OR -<br>\n<code>RadioButtonList.Items(1).Attributes.Add("style", "visibility:hidden")</code></p>\n'}, {'answer_id': 59497513, 'author': 'Sumate Mephokkij', 'author_id': 10863080, 'author_profile': 'https://Stackoverflow.com/users/10863080', 'pm_score': 0, 'selected': False, 'text': '<p>Another answer to not visibility inside a RadioButtonList.</p>\n\n<p>Try this code:</p>\n\n<pre><code>RadioButtonList.Items(1).CssClass.Add("display", "none");\n</code></pre>\n\n<p>and get the job to no display RadioButtonList in layout.</p>\n'}]
['https://Stackoverflow.com/questions/33341', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/877/']