protected void lnkbtnSubmit_OnClick(object sender, EventArgs e) { try { BindDropdownDAL objbind1 = new BindDropdownDAL(); if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0)) { string strchkValue = string.Empty; string sAllItemIdnos = string.Empty; string strchkDetlValue = string.Empty; for (int count = 0; count < grdGrdetals.Rows.Count; count++) { CheckBox ChkGr = (CheckBox)grdGrdetals.Rows[count].FindControl("chkId"); if ((ChkGr != null) && (ChkGr.Checked == true)) { HiddenField hidGrIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidGrIdno"); strchkDetlValue = strchkDetlValue + hidGrIdno.Value + ","; } } if (strchkDetlValue != "") { strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1); } if (strchkDetlValue == "") { ShowMessageErr("Please select atleast one Gr."); ShowDiv("ShowClient('dvGrdetails')"); } else { LorryHireDAL ObjChlnBookingDAL = new LorryHireDAL(); string strSbillNo = String.Empty; DataTable dtRcptDetl = new DataTable(); DataTable dtKMDetl = new DataTable(); dtRcptDetl = ObjChlnBookingDAL.SelectGrChallanDetails(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddlDateRange.SelectedValue), Convert.ToString(strchkDetlValue)); ViewState["dt"] = dtRcptDetl; BindGrid(); grdGrdetals.DataSource = null; grdGrdetals.DataBind(); if (grdMain.Rows.Count > 0) { foreach (GridViewRow Dr in grdMain.Rows) { Label lblSubTotAmnt = (Label)Dr.FindControl("lblSubTotAmnt"); dGrAmnt += Convert.ToDouble(lblSubTotAmnt.Text); } } txtfreight.Text = Convert.ToString(dGrAmnt); netamntcal(); } } else { ShowMessageErr("Gr Details not found."); grdMain.DataSource = null; grdMain.DataBind(); // ddlDelvryPlace.Enabled = true; ShowDiv("ShowBillAgainst('dvGrdetails')"); } } catch (Exception Ex) { ApplicationFunction.ErrorLog(Ex.Message); } }