public void BindJiBePacketGrid() { int rowcount = ucCustomPagerItems.isCountRecord; string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) { sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString()); } DataTable dt = objVessel.Get_JiBePacketStatus_Search(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertIntegerToNull(ddlStatus.SelectedValue), UDFLib.ConvertToInteger(Session["USERCOMPANYID"].ToString()) , UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), sortbycoloumn, sortdirection , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); if (ucCustomPagerItems.isCountRecord == 1) { ucCustomPagerItems.CountTotalRec = rowcount.ToString(); ucCustomPagerItems.BuildPager(); } gvPktStat.DataSource = dt; gvPktStat.DataBind(); }