//Sport Grid Bind #region [Sport Grid Bind] private void GrdSportBind() { try { DataSet ds = objBL.SportGridBind_BL(); if (ds.Tables[0].Rows.Count == 0 || ds == null) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdSport.DataSource = ds; GrdSport.DataBind(); int columncount = GrdSport.Rows[0].Cells.Count; GrdSport.Rows[0].Cells.Clear(); GrdSport.Rows[0].Cells.Add(new TableCell()); GrdSport.Rows[0].Cells[0].ColumnSpan = columncount; GrdSport.Rows[0].Cells[0].Text = "No Records Found"; } else { GrdSport.DataSource = ds; GrdSport.DataBind(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Page Indext Created #region GrdIndexChanged protected void GrdSport_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { GrdSport.PageIndex = e.NewPageIndex; GrdSport.DataSource = objBL.SportGridBind_BL(); GrdSport.DataBind(); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }