468,107 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

mutually exclusive radio button

js
I include a asp:RadioButton in an ItemTemplate of a DataGrid like the
following. However, the radio buttons are not mutual exclusive where
select one will deselect the rest of the radio buttons. I know there is
a similar bug with RadioButton in a DataList. Does this bug also apply
to Datagrid? If not, how can I set them to be selected mutually
exclusively?

<asp:datagrid id="MyDataGrid" runat="server" CssClass="InventoryTable">
<ItemStyle CssClass="inventoryListItemStyle"></ItemStyle>
<AlternatingItemStyle CssClass="inventoryListAlternateItemStyle" />
<HeaderStyle CssClass="inventoryListHeaderStyle"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:RadioButton ID="rdoSelected" Runat="server"
GroupName="rdoGroup"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>

Nov 19 '05 #1
2 3005
Try the RadioButtonList instead.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I include a asp:RadioButton in an ItemTemplate of a DataGrid like the
following. However, the radio buttons are not mutual exclusive where
select one will deselect the rest of the radio buttons. I know there
is a similar bug with RadioButton in a DataList. Does this bug also
apply to Datagrid? If not, how can I set them to be selected mutually
exclusively?

<asp:datagrid id="MyDataGrid" runat="server"
CssClass="InventoryTable">
<ItemStyle CssClass="inventoryListItemStyle"></ItemStyle>
<AlternatingItemStyle CssClass="inventoryListAlternateItemStyle" />
<HeaderStyle CssClass="inventoryListHeaderStyle"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:RadioButton ID="rdoSelected" Runat="server"
GroupName="rdoGroup"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>


Nov 19 '05 #2
js
This won't work because I need only ONE radio button in the first
column of each data row in DataGrid. I need to allow sorting on the
DataGrid header which RadioButtonList does not support or it is not
easy to implement. Any more idea? Thanks.

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MR. UNDERHILL | last post: by
8 posts views Thread by arun | last post: by
2 posts views Thread by arun | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.