A radio button in two groups?
Posted on 2006-04-11
What I need to do is have a series of items in a list, the user will then rank these items. Ranks are mutually exclusive between items.
My idea was to have a group of radio buttons after each item, the user would then select a rank for each item.
Item 1 Rank: R1 R2 R3 R4 R5
Item 2 Rank: R1 R2 R3 R4 R5
Item 3 Rank: R1 R2 R3 R4 R5
Item 4 Rank: R1 R2 R3 R4 R5
Item 5 Rank: R1 R2 R3 R4 R5
The problem with this is that it would then be possible to give two items the same rank. I can think of several ways to keep the item ranks mutually exclusive, but they all involve postbacks every time the user clicks on a radio button. I'd like to avoid that if possible.
I was thinking that if I could extend the radio button control to allow it to be part of two distinct groups (in the above case the first radio button in the item 1 row would belong to a group of all radio buttons associated with item 1, and another group that consists of all "R1" radio buttons. Another way to look at it would be that each number in the grid above belongs to a group consisting of all numbers on its row, and another consisting of all numbers in its column. Hope that makes sense.). The functionality of the radio button would remain the same,
<asp:radiobuttonmod id="RadioButton1" group1name="group1" group2name="group2" runat="server"></asp:radiobuttonmod>
Is this possible?