Good morning, I wonder how I can get the id of a checkbox that is in a table with data generated from sqlserver.
This is how the design of the table is:
<asp:GridView ID="GridViewTable" runat="server" AutoGenerateColumns="False" ShowHeaderWhenEmpty="true" Width="100%" cssClass="table table-responsive">
<Columns>
<asp:BoundField DataField="name" HeaderText="Lineas" />
<asp:templatefield HeaderText="ALL" ControlStyle-CssClass="clase" >
<itemtemplate>
<asp:checkbox ID="csSelectAll"
CssClass="gridCB" runat="server"></asp:checkbox>
</itemtemplate>
</asp:templatefield>
<asp:templatefield HeaderText="Turno A">
<itemtemplate>
<asp:checkbox ID="csSelectA"
CssClass="gridCBA" runat="server"></asp:checkbox>
</itemtemplate>
</asp:templatefield>
<asp:templatefield HeaderText="Turno B">
<itemtemplate>
<asp:checkbox ID="csSelectB"
CssClass="gridCB" runat="server"></asp:checkbox>
</itemtemplate>
</asp:templatefield>
<asp:templatefield HeaderText="Turno C">
<itemtemplate>
<asp:checkbox ID="csSelectC"
CssClass="gridCC" runat="server"></asp:checkbox>
</itemtemplate>
</asp:templatefield>
and that's how I fill it:
SqlDataAdapter adapter = new SqlDataAdapter("SELECT fila FROM tabla", con);
adapter.Fill(subjects);
GridViewTable.DataSource = subjects;
GridViewTable.DataBind();
then as they are generated in automatic according to the number of rows that the table has in sql I do not control which is the checkbox that I select