/* Region is use to bind all pet information from database fro this we need pet type cat or dog */ private void BindGrid(string PetType) { StoreFront ObjStoreFront = new StoreFront(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataView dv = new DataView(); ds = ObjStoreFront.GetBreed(PetType, Request.QueryString["SearchFor"].ToString(), Request.QueryString["SearchText"].ToString()); ddlSearch.SelectedValue = Request.QueryString["SearchFor"].ToString(); txtSearch.Text = Request.QueryString["SearchText"].ToString(); if (ds.Tables[0].Rows.Count > 0) { gdvBreed.Visible = true; btnDelete.Visible = true; btnStatus.Visible = true; //lblNorec.Visible = false; dt = ds.Tables[0]; dv = dt.DefaultView; if ((SortExpression != string.Empty) && (SortDirection != string.Empty)) { dv.Sort = SortExpression + " " + SortDirection; } gdvBreed.DataSource = dv; gdvBreed.DataBind(); CheckAll(); check(); Utility.Setserial(gdvBreed, "srno"); divSelectPet.Visible = true; btnExport.Visible = true; btnImport.Visible = true; divsearch.Visible = true; } else { divsearch.Visible = false; divSelectPet.Visible = false; //lblNorec.Visible = true; btnDelete.Visible = false; btnNew.Visible = true; btnStatus.Visible = false; gdvBreed.Visible = false; ErrMessage("Sorry, No records found."); if ((Convert.ToInt32(ddlSearch.SelectedIndex) > 0) && (txtSearch.Text != "")) { txtSearch.Text = ""; ddlSearch.SelectedIndex = 0; lnkNorec.Visible = true; btnNew.Visible = false; // btnAdd.Visible = false; btnExport.Visible = false; btnImport.Visible = false; divSelectPet.Visible = false; //lblMsg.Visible = true; ErrMessage("Sorry, No records found."); } } }