I am new to asp .net.
How can i add radio button column into listview in asp .net? I could add the radio button into listview but they are not grouped and the user can select multiple radio buttons which I don't want.
I am new to asp .net.
How can i add radio button column into listview in asp .net? I could add the radio button into listview but they are not grouped and the user can select multiple radio buttons which I don't want.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted May 1, 2009, 1:25 AM EDT
m s3 reputationPosted May 2, 2009, 1:49 PM EDT
Hi
I tried but it did not work. The radio button appeared but the user could select more than one row which i don't want it. Any other suggestion will be appreciated. If it worked for you before, pls show me that code fragment.
Thanks
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted May 4, 2009, 3:23 AM EDT
You can validate it using JavaScript.
var obj = window.document.getElementById("dgrdRegistration")
var intLoop;
var intRowCnt;
var check;
if(window.document.getElementsByName("dgrdRegistration").length !=0)
{
intRowCnt = obj.rows.length ;
for(intLoop=1;intLoop<=intRowCnt;intLoop++)
{
if (intLoop < 9 )
{
var strCtrlName = 'dgrdRegistration_ctl0' + (intLoop+1) + '_chkRegistration';
if(window.document.getElementById(strCtrlName).checked == true)
{
window.document.getElementById(strCtrlName).checked = false;
}
}
Else
{
var strCtrlName1 = 'dgrdRegistration_ctl' + (intLoop+1) + '_chkRegistration';
if(window.document.getElementById(strCtrlName1).checked == true)
{
window.document.getElementById(strCtrlName1).checked = false;
}
}
}
My datagrid id is “dgrdRegistration” and “chkRegistration” is the radio button id