title: Update Gridview with data from radio button list on button click
body: <p>Good Day!</p>
  
  <p>I'm having a hard time with my Gridview. I'm using C#.net and sql server. I want to update my gridview rows with the data from the column of radio button list with a button outside gridview. Here's my gridview;</p>
  
  <p><a href="https://i.stack.imgur.com/bjR58.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bjR58.jpg" alt="enter image description here"></a></p>
  
  <p>I want to update column[rating] with the selected value from radio button list on a single button click.</p>
  
  <p>Currently, I update the gridview column rating by clicking the rate button and getting the rating value from the dropdown list above the gridview.</p>
  
  <p>Now, I'm wondering if there's a way to do it on one click and get it's value from the radio button list inside the gridview. My gridview code is here;</p>
  
  <pre><code>&lt;p&gt;
                  &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onrowcommand="delete_enroll" 
                      DataSourceID="training" Width="826px" AllowPaging="True" Visible="False" 
                      style="text-align: center"&gt;
                      &lt;Columns&gt;
                          &lt;asp:ButtonField ButtonType="Button" CommandName="deleterow" Text="CANCEL" /&gt;
                          &lt;asp:ButtonField ButtonType="Button" CommandName="RATE" Text="RATE" /&gt;
                          &lt;asp:BoundField DataField="Training_id" HeaderText="Training_id" 
                              SortExpression="Training_id" /&gt;
                          &lt;asp:BoundField DataField="User_id" HeaderText="User_id" 
                              SortExpression="User_id" /&gt;
                          &lt;asp:BoundField DataField="User_name" HeaderText="User_name" 
                              SortExpression="User_name" /&gt;
                          &lt;asp:BoundField DataField="Date_enrolled" HeaderText="Date_enrolled" 
                              SortExpression="Date_enrolled" /&gt;
                          &lt;asp:BoundField DataField="Rating" HeaderText="Rating" 
                              SortExpression="Rating" /&gt;
  
                              &lt;asp:TemplateField HeaderText="Rate"&gt;
                                  &lt;ItemTemplate&gt;
                                      &lt;asp:RadioButtonList ID="RadioButtonList1" runat="server"&gt;
                                          &lt;asp:ListItem Text="Passed" Value="Passed"&gt;&lt;/asp:ListItem&gt;
                                          &lt;asp:ListItem Text="Failed" Value="Failed"&gt;&lt;/asp:ListItem&gt;
                                      &lt;/asp:RadioButtonList&gt;
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:TemplateField&gt;
  
                      &lt;/Columns&gt;
                  &lt;/asp:GridView&gt;
              &lt;/p&gt;
  </code></pre>
  
  <p>Any help would be appreciated. Thanks! </p>