Hi amar,
Refer the below sample for your reference and impliment it as per your code logic in your code.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript">
function RadioCheck(rb) {
var gv = document.getElementById("<%=GridView1.ClientID%>");
var inputs = gv.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "radio") {
var row = inputs[i].parentNode.parentNode;
var txtItemQuantity = GetChildControl(row, "txtItemQuantity");
var txtThirdCell = GetChildControl(row, "txtThirdCell");
if (inputs[i].checked && inputs[i].id != rb.id) {
inputs[i].checked = false;
txtItemQuantity.disabled = true;
txtThirdCell.disabled = true;
txtItemQuantity.value = "";
txtThirdCell.value = "";
}
else if (inputs[i].checked && inputs[i].id == rb.id) {
txtItemQuantity.disabled = false;
txtThirdCell.disabled = false;
}
else {
txtItemQuantity.disabled = true;
txtThirdCell.disabled = true;
txtItemQuantity.value = "";
txtThirdCell.value = "";
}
}
}
}
function GetChildControl(element, id) {
var child_elements = element.getElementsByTagName("*");
for (var i = 0; i < child_elements.length; i++) {
if (child_elements[i].id.indexOf(id) != -1) {
return child_elements[i];
}
}
};
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" HeaderStyle-BackColor="green" AutoGenerateColumns="false"
Font-Names="Arial" Font-Size="11pt" AlternatingRowStyle-BackColor="#C2D69B" AllowPaging="true">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:RadioButton ID="RadioButton1" runat="server" onclick="RadioCheck(this);" />
<asp:Label ID="lblValue" runat="server" Text='<%#Eval("Option") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Item Qty">
<ItemTemplate>
<asp:TextBox ID="txtItemQuantity" runat="server" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Third Cell">
<ItemTemplate>
<asp:TextBox ID="txtThirdCell" runat="server" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[1] { new DataColumn("Option", typeof(string)) });
dt.Rows.Add("IC001");
dt.Rows.Add("IC002");
dt.Rows.Add("IC003");
dt.Rows.Add("IC004");
dt.Rows.Add("IC005");
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
VB.Net
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As New DataTable()
dt.Columns.AddRange(New DataColumn(0) {New DataColumn("Option", GetType(String))})
dt.Rows.Add("IC001")
dt.Rows.Add("IC002")
dt.Rows.Add("IC003")
dt.Rows.Add("IC004")
dt.Rows.Add("IC005")
GridView1.DataSource = dt
GridView1.DataBind()
End If
End Sub
Screenshot