protected void imgButtonEidt_Click(object sender, ImageClickEventArgs e) { try { ImageButton imgbtn = (ImageButton)sender; GridViewRow row = (GridViewRow)imgbtn.NamingContainer; Label lblID = (Label)grdMasterLC.Rows[row.RowIndex].FindControl("lblID"); int LcId = Convert.ToInt16(lblID.Text); LC_MasterLC _MSLc = _masterlcBLL.GetLcLById(LcId); if (_MSLc != null) { HidLcNo.Value = _MSLc.MlcID.ToString(); ddlSubCompany.SelectedItem.Text = _MSLc.SubCompanyName.ToString(); txtLcNo.Text = _MSLc.LCNo; txtDateofIssue.Text = _MSLc.DateofIssue.ToString(); txtDateofExpiry.Text = _MSLc.DateofExpiry.ToString(); txtIssueBank.Text = _MSLc.LC_Issue_Bank; ddlBuyerType.SelectedValue = _MSLc.BuyerType.ToString(); FillLCNoandOEntry(); ddlBuyerName.SelectedValue = _MSLc.Buyer_ID.ToString(); txtSeason.Text = _MSLc.Season; txtQty.Text = _MSLc.Qty.ToString(); txtUSDV.Text = _MSLc.LC_USDValu.ToString(); txtConvRate.Text = _MSLc.Conv_Rate.ToString(); txtBDTV.Text = _MSLc.LC_BDTValu.ToString(); btnSubmit.Text = "Update"; } } catch (Exception ex) { throw ex; } }