title: Set the groupname of dynamically created radio buttons in gridview in C# code in asp.net
body: <p>In a asp.net project I should create RadioButtons in Run time and place them in a GridView according to my gridview rows count.The problem is that in client HTML created by asp, the groupname of each radio is different because radios are in different rows despite I made the groupname of all radios same and user can select multi radios. My C# Code:</p>
  
  <pre><code>        List&lt;RadioButton&gt; selectRBtns = new List&lt;RadioButton&gt;();              
          for (int i = 0; i &lt; dT.Rows.Count;i++ ) //dT is my datatable
          {
              RadioButton rBtn = new RadioButton();
              rBtn.ID = "rBtn" + i.ToString();
              rBtn.GroupName = "selector";
              selectRBtns.Add(rBtn);
          }
  
          dT.Columns.Add("select");
          myGrid.DataSource = dT;
          myGrid.DataBind();
  
          for (int i = 0; i &lt; myGrid.Rows.Count; i++)
          {
              myGrid.Rows[i].Cells[dT.Columns.Count - 1].Controls.Add(selectRBtns[i]);
          } 
  </code></pre>
  
  <p>please help me.</p>