コード例 #1
0
        //Designation Grid Bind
        #region [Designation Grid Bind]

        private void GrdDesignationBind()
        {
            try
            {
                objEWA.OrgId        = orgId;
                objEWA.DepartmentId = Convert.ToInt32(ddlDepartment.SelectedValue);
                DataSet ds = objBL.DesignationGridBind_BL(objEWA);
                if (ds.Tables[0].Rows.Count == 0 || ds == null)
                {
                    ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
                    GrdDesignation.DataSource = ds;
                    GrdDesignation.DataBind();
                    int columncount = GrdDesignation.Rows[0].Cells.Count;
                    GrdDesignation.Rows[0].Cells.Clear();
                    GrdDesignation.Rows[0].Cells.Add(new TableCell());
                    GrdDesignation.Rows[0].Cells[0].ColumnSpan = columncount;
                    GrdDesignation.Rows[0].Cells[0].Text       = "No Records Found";
                }
                else
                {
                    GrdDesignation.DataSource = ds;
                    GrdDesignation.DataBind();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
コード例 #2
0
        //Page Indext Created
        #region GrdIndexChanged

        protected void GrdDesignation_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                objEWA.OrgId              = orgId;
                objEWA.DepartmentId       = Convert.ToInt32(ddlDepartment.SelectedValue);
                GrdDesignation.PageIndex  = e.NewPageIndex;
                GrdDesignation.DataSource = objBL.DesignationGridBind_BL(objEWA);
                GrdDesignation.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }