In my example, there's a list of radio buttons. The list may (or may not) include a radio button labeled "Countdown". If the list includes a "Countdown" radio button, then I want to disable it. Furthermore, if "Countdown" was selected, I want to instead select the first radio button in the list. Here's the code:
foreach (ListItem listItem in rblSelectionType.Items)
{
if (listItem.Text == "Countdown")
{
if (listItem.Selected)
rblSelectionType.SelectedIndex = 0;
listItem.Enabled = false;
break;
}
}
Thanks to this tutorial for setting me on the right track.