<asp:GridView ID="grdPurchaseBill" runat="server" CssClass="grdcls grdstyle" ShowHeader="true" AutoGenerateColumns="false" ShowFooter="true" AllowSorting="true" ShowHeaderWhenEmpty="true" EmptyDataText="No Records Found"> <Columns> <asp:CommandField ShowDeleteButton="True" ButtonType="Link" DeleteImageUrl="~/Images/trash.png" FooterStyle-BorderStyle="None" ItemStyle-BorderStyle="None" HeaderText="Action"> </asp:CommandField> </asp:CommandField> <asp:BoundField DataField="AcctId" HeaderText="Accout ID" /> <asp:BoundField DataField="CreditToAccount" /> <asp:BoundField DataField="Amount" HeaderText="Amount" /> <asp:BoundField DataField="Vat" HeaderText="VAT%" /> <asp:BoundField DataField="BasicAmount" HeaderText="Basic Amt." /> </Columns> </asp:GridView>
protected void grdPurchaseBill_RowCommand(object sender, GridViewCommandEventArgs e) { try { int index = Convert.ToInt32(e.CommandName.ToString()); string accidno = grdPurchaseBill.Rows[index].Cells[2].Text.ToString(); txtCreditToAcc.Text = accidno; txtamount.Text = grdPurchaseBill.Rows[index].Cells[3].Text.ToString(); txtVat.Text = grdPurchaseBill.Rows[index].Cells[4].Text.ToString(); txtBasicAmount.Text = grdPurchaseBill.Rows[index].Cells[5].Text.ToString(); } catch (Exception ex) { } }
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(grdjournalvoucher, "$" + e.Row.RowIndex, false);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)