Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid with Radio Button

Status
Not open for further replies.

onedizzydevil

Programmer
Mar 24, 2001
103
US
I have a Radio button in tha datagrid, if the Radio button is NOT runat="server" the button will not allow me to selection any of them. If I include runat="server" the system changes all the ids and values which allows for someone to select them all when I. Has any dealt with this yet? Any solutions or idea?

All I am doing is creating custom column and one of the columns is this:

<asp:TemplateColumn>
<ItemTemplate>
<input type=&quot;radio&quot; id=&quot;user&quot; value='<%# databinder.eval(container.dataitem,&quot;userid&quot;)%>'>
</ItemTemplate>
</asp:TemplateColumn>

Thanks for the help
Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
If you use the runat=server on an asp:radiobutton, then you must specify 'groupName' to group some of them together....

it replaces the html equiv, name.

You can also look into the radio button list server control, but personally, I have found very few places where I could use it because you don't have much control over how it renders itself (text over, or beside, horiz, vert, etc...)

I use the groupName property of the asp:radiobutton and it works quite nicely.

good luck-
paul
penny1.gif
penny1.gif
 
I does not work, even if I put this in there:

<asp:RadioButton id=&quot;rdo1_slection&quot; GroupName=&quot;userid&quot; runat=&quot;server&quot;></asp:RadioButton>

it still allow me to select all of them. This is what it is doing after the code runs:


<input id=&quot;dgActive__ctl17_rdo1_slection&quot; type=&quot;radio&quot; name=&quot;dgActive:_ctl17:userid&quot; value=&quot;rdo1_slection&quot; />

<input id=&quot;dgActive__ctl4_rdo1_slection&quot; type=&quot;radio&quot; name=&quot;dgActive:_ctl4:userid&quot; value=&quot;rdo1_slection&quot; />


I even tested it outside of the multipage control and still does the same thing?

Any other ideas? Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
The following code is running and working properly on our intranet right now:

<asp:radiobutton id=&quot;rdoStatus1&quot; GroupName=&quot;status&quot; Runat=&quot;server&quot; />
<asp:radiobutton id=&quot;rdoStatus2&quot; GroupName=&quot;status&quot; Runat=&quot;server&quot; />
<asp:radiobutton id=&quot;rdoStatus3&quot; GroupName=&quot;status&quot; Runat=&quot;server&quot; />
<asp:radiobutton id=&quot;rdoStatus4&quot; GroupName=&quot;status&quot; Runat=&quot;server&quot; />
penny1.gif
penny1.gif
 
Okay, I think something is broken then. Just to double check, you code is directly in an &quot;<asp:TemplateColumn><ItemTemplate>&quot; on the .aspx page correct? Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
This is the correct answer for anyone who wants to know


Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top