protected void FillGrid() { BA_hiringprocess bahire = new BA_hiringprocess(); string location = string.Empty, expFrom = string.Empty, expTo = string.Empty; string skills = txtSkills.Text; if (ddlLocation.SelectedValue == "0") { location = string.Empty; } else { location = ddlLocation.SelectedValue; } if (ddlFrom.SelectedValue == "-1") { expFrom = "0"; } else { expFrom = ddlFrom.SelectedItem.Text; } if (ddlTo.SelectedValue == "-1") { expTo = "0"; } else { expTo = ddlTo.SelectedItem.Text; } ds = getJobApplicants(skills, location, expFrom, expTo); DataView dv = new DataView(ds.Tables[0]); dv.Sort = ddlSort.SelectedValue.ToString(); //ds.Tables[0].DefaultView.Sort = ddlSort.SelectedValue.ToString().Trim(); dataBind(dv); }
protected void FillGrid() { BA_hiringprocess bahire = new BA_hiringprocess(); DataSet ds = new DataSet(); ds = bahire.gethiredprocess(Convert.ToInt32(ViewState["orderby"].ToString()), Session["PSEName"].ToString()); // DataTable dataTable = this.GetDataTable(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { pnlMain.Visible = true; pnlSub.Visible = false; _PageDataSource.DataSource = ds.Tables[0].DefaultView; _PageDataSource.AllowPaging = true; _PageDataSource.PageSize = PageSize; _PageDataSource.CurrentPageIndex = CurrentPage; ViewState["TotalPages"] = _PageDataSource.PageCount; this.lblPageInfo.Text = "Page " + (CurrentPage + 1) + " of " + _PageDataSource.PageCount; this.lbtnPrevious.Enabled = !_PageDataSource.IsFirstPage; this.lbtnNext.Enabled = !_PageDataSource.IsLastPage; this.lbtnFirst.Enabled = !_PageDataSource.IsFirstPage; dljobdet.DataSource = _PageDataSource; dljobdet.DataBind(); this.doPaging(); } else { pnlMain.Visible = false; pnlSub.Visible = true; } } else { pnlMain.Visible = false; pnlSub.Visible = true; } }