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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niradhip ChakrabortyPosted May 4, 2009, 7:23 AM
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
m sPosted May 2, 2009, 5:49 PM
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 ChakrabortyPosted May 1, 2009, 5:25 AM