title: Select one Gridview row with radio button ASP.NET
body: <p>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#</p>
  
  <pre><code>&lt;asp:GridView ID="DateGrid" runat="server" CellPadding="4" ForeColor="#333333" 
      GridLines="None" &gt;
      &lt;AlternatingRowStyle BackColor="White" /&gt;
     &lt;Columns&gt;
     &lt;asp:TemplateField&gt;
     &lt;ItemTemplate&gt;
   &lt;asp:RadioButton ID="RowSelector" runat="server" GroupName="SelectGroup" /&gt;
    &lt;/ItemTemplate&gt;
   &lt;/asp:TemplateField&gt;
   &lt;/Columns&gt; 
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Code Behind:</p>
  
  <pre><code>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;
  </code></pre>