title: how to populate a list from a asp .net grid view?
body: <p>I have a Grid View, I want to update all the rows that will be selected by checking the checkbook. First I want all the selected rows into a list. I don know how to do it. I know how to populate a grid from a list.
  my grid view is</p>
  
  <pre><code>&lt;asp:GridView runat="server" ID="GridForResult" 
          Visible="true" 
          ShowHeader="false"
          AutoGenerateColumns="false"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField ItemStyle-Width="120px" ItemStyle-Height="22px"&gt;
              &lt;ItemTemplate&gt;
                  &lt;%#Eval( "TestRoll")%&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField ItemStyle-Width="150px" ItemStyle-Height="22px"&gt;
              &lt;ItemTemplate&gt;
                  &lt;%#Eval( "Name")%&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField ItemStyle-Width="80px" ItemStyle-Height="22px"&gt;
              &lt;ItemTemplate&gt;
                  &lt;%#Eval( "Program")%&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField ItemStyle-Width="80px" ItemStyle-Height="22px"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="chkSelected" runat="server" Text="Selected" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>My another problem is How to get only the selected (checkboxes) rows from the gridview?</p>