Hi Friend,
Please find the solution below.
Add the below javascript to your aspx page.
<script language="javascript" type="text/javascript">
function SelectSingleRadiobutton(rdbtnid, id) {
var rdBtn = document.getElementById(rdbtnid);
var rdBtnList = document.getElementsByTagName("input");
for (i = 0; i < rdBtnList.length; i++) {
if (rdBtnList[i].type == "radio" && rdBtnList[i].id != rdBtn.id) {
var radname = rdBtnList[i].getAttribute('name');
var radid = radname.substring(radname.length - 4, radname.length);
if (radid == id)
rdBtnList[i].checked = false;
}
}
}
</script>
Hope you have two RadioButton fields / columns placed in the TemplateField of your GridView as below. Invoke the javascript in the "onclick" event of both RadioButton.
<asp:TemplateField HeaderText="Radio 1">
<ItemTemplate>
<asp:RadioButton type="radio" ID="rad1" runat="server" onclick="SelectSingleRadiobutton(this.id,'rad1');" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Radio 2">
<ItemTemplate>
<asp:RadioButton type="radio" ID="rad2" runat="server" onclick="SelectSingleRadiobutton(this.id,'rad2');" />
</ItemTemplate>
</asp:TemplateField>
Hope this helps you!!