Vikas Singh

Vikas Singh

  • 1.3k
  • 410
  • 14.5k

GridView Is not firing onrowcommand for checkbox please help

Sep 12 2020 1:27 AM
 
I don't want to use loop for our work.I want that after select check box pic a value of checkbox and add in a array with out using loop. 
This is check box 
<asp:CheckBox runat="server" ID="chkselect" CommandArgument='<%# Eval("hnysku") %>'
CommandName="chkboxselect" AutoPostBack="true" />
  
Here rowcommand is not working 
 
Please help 
 
 
 
<asp:GridView ID="GRDProducts" runat="server" AutoGenerateColumns="false" ShowHeader="true" AllowSorting="false"
OnRowCommand="GRDProducts_RowCommand" CssClass="table table-striped table-bordered Datatablewithsorting">
<Columns>
<asp:TemplateField HeaderText="Sno">
<ItemTemplate>
<%# Container.DataItemIndex+1 %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SKU">
<ItemTemplate>
<asp:Label runat="server" ID="lblSku" Text='<%# Eval("hnysku") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Product Name">
<ItemTemplate>
<asp:Label runat="server" ID="lblProdname" Text='<%# Eval("title") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:UpdatePanel runat="server" ID="updategrid">
<ContentTemplate>
<asp:CheckBox runat="server" ID="chkselect" CommandArgument='<%# Eval("hnysku") %>'
CommandName="chkboxselect" AutoPostBack="true"  />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#066b04" ForeColor="#ffffff" />
</asp:GridView>

Answers (4)