protected void lnkbtnSubmitok_OnClick(object sender, EventArgs e) { try { Int32 iRateType = 0; double dcommssn = 0, dweight = 0, dqty = 0, dtotcommssn = 0; if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0)) { string strchkValue = string.Empty; string sAllItemIdnos = string.Empty; string strchkDetlValue = string.Empty; Int32 Count = 0; 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 + ","; Count = Count + 1; } } if (strchkDetlValue != "") { strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1); } if (strchkDetlValue == "") { ShowMessageErr("Please select atleast one Gr."); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true); return; } if (Count > 1) { ShowMessageErr("Please select only one Gr. at a time"); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true); return; } else { FreightMemoDAL ObjFreightMemoDAL = new FreightMemoDAL(); string strSbillNo = String.Empty; DataTable dtRcptDetl = new DataTable(); DataRow Dr; dtRcptDetl = ObjFreightMemoDAL.SelectGRDetailInRcpt(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddldateRange.SelectedValue), Convert.ToString(strchkDetlValue)); ViewState["dt"] = dtRcptDetl; BindValues(dtRcptDetl); grdGrdetals.DataSource = null; grdGrdetals.DataBind(); } } else { ShowMessageErr("Gr Details not found."); ShowDiv("ShowBillAgainst('dvGrdetails')"); } } catch (Exception Ex) { ApplicationFunction.ErrorLog(Ex.Message); } }