I have gridview in my application . in tat i have some fields as wel as 2 template colum which has linkbutton and check box. i have written coding in GridView1_RowCommand()
so it fires for link button properly but when i check the check box it wont fire..where as wheni check check box ten click the link button means its working i need separately the checkbox should fire and give the vale.what is the propery of checkbox to fire the row.

this is HTML codings

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"ForeColor="#333333" GridLines="None" Width="780px" OnRowCommand="GridView1_RowCommand" ><FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
         <asp:BoundField DataField="purno" HeaderText="PurchaseOrderNo" />
         <asp:BoundField DataField="purdate" HeaderText="PurchaseOderDate" />
         <asp:BoundField DataField="suppliername" HeaderText="SupplierName" />
         <asp:TemplateField HeaderText="View"><ItemTemplate>
         <asp:LinkButton ID="lnk_view" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"purno")%>' CommandName="show" Font-Bold="True">View</asp:LinkButton>
              <asp:TemplateField HeaderText="Approval">
 <ItemTemplate><asp:CheckBox ID="chk_app" runat="server" Font-Bold="True"  Text="Approved" AutoPostBack="True"  />                                 </ItemTemplate></asp:TemplateField></Columns> </asp:GridView>
this is c# codings
  protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {  if (e.CommandName == "show")
        {   prno = e.CommandArgument.ToString();
            GridView2.Visible = true;
            loadgridview2();        }       
            foreach (GridViewRow gv in GridView1.Rows)
            {   CheckBox chk = new CheckBox();
                chk = ((CheckBox)gv.Controls[0].FindControl("chk_app"));
                if (chk.Checked)
                {  Response.Write("u have checked");
                }            }       }

hi i got the msg when i checked the check box.i have written the coding in checkbox event [chk_app_CheckedChanged] but i need to know when i check the check box i need that row's first colum value ie., pno it is in first column in grid view so pls help me very urgent ..
thanking u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.