I have a Gridview binded to a database table with a Radio Button Column, I want to select a row with single radio button. It is necessary a radio button group? I have that code above with checkbox but i want to change it to radio button. I think radio button code is similiar. Thank you. I'm using ASP.NET C#
<asp:GridView ID="DateGrid" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" >
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:RadioButton ID="RowSelector" runat="server" GroupName="SelectGroup" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code Behind:
foreach (GridViewRow row in DateGrid.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
CheckBox chkRow = (row.Cells[0].FindControl("DateChBox") as CheckBox);
if (chkRow.Checked)
{
startdate = row.Cells[2].Text;
enddate = row.Cells[3].Text;