jeudi 2 décembre 2021

Record identification in Gridview checkbox onclick event

I have a checkboxs column in asp:gridview. How can i identify which record i clicked on in a JS onclick event of the checkbox? (how can i know which row i clicked on?).

the grid and the checkbox column:

<asp:GridView ID="gvBakashot" Style="margin-top: 0%; table-layout: fixed; margin-right: 3%;" runat="server" HeaderStyle-BorderStyle="none" CssClass="GridClass box_border"
Width="94%" AutoGenerateColumns="false" CellPadding="2" RowStyle-CssClass="row1" EnableEventValidation="true" ClientIDMode="Static" Visible="true">
<Columns>
<asp:TemplateField HeaderText=" " ItemStyle-BorderWidth="1" HeaderStyle-Width="3%" ItemStyle-Width="3%" HeaderStyle-CssClass="box_border table_title" ItemStyle-CssClass="box_border ">
<ItemTemplate>               
<input type="checkbox" id="chkHaktzaa" onclick="chkHaktzaa_click()" />
</ItemTemplate>
</asp:TemplateField>

Thank you for the help.




Aucun commentaire:

Enregistrer un commentaire