Using column two radio buttons in DataGrid
<p>I created two template column in DataGrid.I assigned radio buttons to those columns.I created single selection by calling a javascript function for the first radio button.
 But,I cant't do single selection by calling a javascript function for the second radio button.Also,I can't run independently of each other.</p>

<pre><code>      &lt;asp:TemplateColumn HeaderText=""&gt;
     &lt;ItemTemplate&gt;
      &lt;input type="radio" runat="server" id="rd1" onclick="SelectOne(this,'DataGrid')" VALUE="rd1"
       NAME="RadioGroup1" /&gt;
     &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateColumn&gt;
    &lt;asp:TemplateColumn HeaderText=""&gt;

     &lt;ItemTemplate&gt;
      &lt;input type="radio" runat="server" id="rd2" onclick="test(this,'DataGrid')" VALUE="rd2" 
      NAME="RadioGroup2" /&gt;      
     &lt;/ItemTemplate&gt;
    &lt;/asp:TemplateColumn&gt;
</code></pre>

<p>Javascript Code:</p>

<pre><code>  &lt;script  language="javascript"&gt;
  function SelectOne(rd1,DataGrid)
  {
  all=document.getElementsByTagName("input");
  for(i=0;i&lt;all.length;i++)
  {
  if(all.type=="radio")
   {
   var count=all.id.indexOf(DataGrid+'__ctl');
  if(count!=-1)
   {
    all.checked=false;
   }
   }
  }
   rd1.checked=true;
  }
  &lt;/script&gt;
</code></pre>
