[thelist] Uncheck Items in Radio Button List

Mattio Valentino mattio.valentino at gmail.com
Thu Jun 7 07:59:49 CDT 2007


Casey,

If you really need to do this, here's one way.

<asp:RadioButtonList ID="rbtnListTest" runat="server">
  <asp:ListItem Selected="True">One</asp:ListItem>
  <asp:ListItem>Two</asp:ListItem>
  <asp:ListItem>Three</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="btnUncheck" runat="server" Text="Uncheck"
OnClick="btnUncheck_Click" />

...

protected void btnUncheck_Click(object sender, EventArgs e)
{
  rbtnListTest.SelectedItem.Selected = false;
}

Note that this does cause a postback.

Hope this helps.

On 6/6/07, Casey Crookston <caseyc at intellisoftmn.com> wrote:
> In .net 2.0, how would you un-select all items in a radio-button list?
>
>
>
> Thanks,
>
>
>
> Casey
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list