Live Chat Icon For mobile
Live Chat Icon

How to have mutually exclusive radiobutton controls in a datagrid.

Platform: ASP.NET| Category: DataGrid

<asp:DataGrid id='DataGrid1' AutoGenerateColumns='False' runat='server'>
		<asp:TemplateColumn HeaderText='FirstName'>
				<input type='radio' name='optSelectedName' 
value=<%#DataBinder.Eval(Container.DataItem, 'FirstName') %> 
onclick='javascript:txtFname.value = this.value;'><%#DataBinder.Eval(Container.DataItem, 'FirstName') %>
<asp:Button id='Button1' style='Z-INDEX: 101; LEFT: 154px; POSITION: absolute; TOP: 103px' runat='server'
<div style='VISIBILITY: hidden'>
	<asp:TextBox ID='txtFname' Runat='server' />


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
	’Bind the Datagrid with dataSet
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  	Response.Write('You have selected :' & txtFname.Text)
End Sub


private void Page_Load(object sender, System.EventArgs e)
	//Bind the datagrid to dataset
private void Button1_Click(object sender, System.EventArgs e)
	        Response.Write('You have selected :' + txtFname.Text);

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.