title: ASP Read value from RadioButtonList inside of a GridView
body: <p>I have a ASP.NET GridView which I fill with data, one button, and one RadioButtonList with 4 radio buttons. How can I get which radio button is selected by pressing a button outside of the GridView (using c# codebehind)?
  The button inside the GridView shall be used for removing a row (RowCommand event I think...)</p>
  <p>Code from within the GridView:</p>
  <pre><code>&lt;Columns&gt;
      &lt;asp:BoundField DataField=&quot;name&quot; HeaderText=&quot;Name&quot; /&gt;
      &lt;asp:BoundField DataField=&quot;value&quot; HeaderText=&quot;Value&quot; /&gt;
      &lt;asp:TemplateField ShowHeader=&quot;false&quot; HeaderText=&quot;Foo?&quot;&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:RadioButtonList ID=&quot;RadioButtonList1&quot; runat=&quot;server&quot; RepeatDirection=&quot;Horizontal&quot;&gt;
                  &lt;asp:ListItem Selected=&quot;true&quot;&gt;Item 1&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Item 1&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Item 2&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Item 3&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Item 4&lt;/asp:ListItem&gt;
              &lt;/asp:RadioButtonList&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:TemplateField ShowHeader=&quot;false&quot; HeaderText=&quot;&quot;&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Remove&quot; /&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  &lt;/Columns&gt;
  </code></pre>