private void BindScreen_By_SrceenID() { if (ViewState["ScreenID"] != null) { try { DataTable dtdetails = new DataTable(); gvDetails.DataSource = null; gvDetails.DataBind(); dtdetails = BLL_Infra_ShipSettings.Get_Exist_Dtails_ByScreenID(UDFLib.ConvertToInteger(ViewState["ScreenID"])); if (dtdetails.Rows.Count > 0) { gvDetails.DataSource = dtdetails; gvDetails.DataBind(); } ucCustomPagerItems.Visible = false; upDetails.Update(); } catch (Exception) { throw; } } else { gvDetails.DataSource = null; gvDetails.DataBind(); upDetails.Update(); } }