예제 #1
0
        //Merge  Employee Name For Individual
        //        #region [Merge Employee Name For Individual]
        //        protected void OnDataBound(object sender, EventArgs e)
        //        {
        //            for (int i = GrdEmployee.Rows.Count - 1; i > 0; i--)
        //            {
        //                GridViewRow row = GrdEmployee.Rows[i];
        //                GridViewRow previousRow = GrdEmployee.Rows[i - 1];
        //                for (int j = 0; j < row.Cells.Count - 2; j++)
        //                {
        //                    //run this loop for the column which you thing the data will be similar
        //                    if ((row.Cells[j]).Text == (previousRow.Cells[j]).Text)
        //                    {
        //                        if (previousRow.Cells[j].RowSpan == 0)
        //                        {
        //                            if (row.Cells[j].RowSpan == 0)
        //                            {
        //                                previousRow.Cells[j].RowSpan += 2;
        //                            }
        //                            else
        //                            {
        //                                previousRow.Cells[j].RowSpan = row.Cells[j].RowSpan + 1;
        //                            }
        //                            row.Cells[j].Visible = false;
        //                        }
        //                    }
        //                }
        //            }
        //        }
        //#endregion

        //Merge Employee Name For All
        //#region [Merge Employee Name  For All]
        //protected void OnDataBound1(object sender, EventArgs e)
        //{

        //    for (int i = GrdAllEmployee.Rows.Count - 1; i > 0; i--)
        //    {
        //        GridViewRow row = GrdAllEmployee.Rows[i];
        //        GridViewRow previousRow = GrdAllEmployee.Rows[i - 1];
        //        for (int j = 0; j < row.Cells.Count - 2; j++)
        //        {
        //            //run this loop for the column which you thing the data will be similar
        //            //if (((CheckBox)row.Cells[j].FindControl("checkbox")).Text == ((CheckBox)previousRow.Cells[j].FindControl("checkbox")).Text)
        //            if ((row.Cells[j + 1]).Text == (previousRow.Cells[j + 1]).Text)
        //            {
        //                if (previousRow.Cells[j].RowSpan == 0)
        //                {
        //                    if (row.Cells[j].RowSpan == 0)
        //                    {
        //                        previousRow.Cells[j].RowSpan += 2;
        //                    }
        //                    else
        //                    {
        //                        previousRow.Cells[j].RowSpan = row.Cells[j].RowSpan + 1;
        //                    }
        //                    row.Cells[j].Visible = false;
        //                }
        //            }
        //        }
        //    }
        //}
        //#endregion

        //Page Index Created
        #region GrdIndexChanged
        protected void GrdAllEmployee_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                GrdAllEmployee.PageIndex = e.NewPageIndex;

                GrdAllEmployee.DataSource = objBL.AllEmployeeGridBind_BL(objEWA);
                GrdAllEmployee.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
예제 #2
0
 private void GrdAllEmployeeBind()
 {
     try
     {
         objEWA.Action = "FetchAllEmployee";
         objEWA.OrgId  = Convert.ToInt32(Session["OrgId"].ToString());
         DataSet ds = objBL.AllEmployeeGridBind_BL(objEWA);
         GrdAllEmployee.DataSource = ds;
         GrdAllEmployee.DataBind();
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }