//State Grid Bind
        #region [State Grid Bind]

        private void GrdStateBind()
        {
            try
            {
                objEWA           = new EWA_CountryStateDistrict();
                objEWA.Action    = "SelectDataState";
                objEWA.CountryId = ddlCountryS.SelectedValue.ToString();
                if (ddlCountryS.SelectedValue.ToString() != "Select")
                {
                    DataSet ds = objBL.StateGridBind_BL(objEWA);
                    if (ds.Tables[0].Rows.Count == 0 || ds == null)
                    {
                        ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
                        GrdState.DataSource = ds;
                        GrdState.DataBind();
                        int columncount = GrdState.Rows[0].Cells.Count;
                        GrdState.Rows[0].Cells.Clear();
                        GrdState.Rows[0].Cells.Add(new TableCell());
                        GrdState.Rows[0].Cells[0].ColumnSpan = columncount;
                        GrdState.Rows[0].Cells[0].Text       = "No Records Found";
                    }
                    else
                    {
                        GrdState.DataSource = ds;
                        GrdState.DataBind();
                    }
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
        //Page Indext Created
        #region GrdIndexChanged

        protected void GrdState_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                GrdState.PageIndex  = e.NewPageIndex;
                objEWA              = new EWA_CountryStateDistrict();
                objEWA.Action       = "SelectDataState";
                objEWA.CountryId    = ddlCountryS.SelectedValue.ToString();
                GrdState.DataSource = objBL.StateGridBind_BL(objEWA);
                GrdState.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Ejemplo n.º 3
0
 private void BindState()
 {
     try
     {
         DataTable dt = new DataTable();
         dt = objBL_User_Master.BL_BindState(objML_User_Master);
         if (dt.Rows.Count > 0)
         {
             GrdState.DataSource = dt;
             GrdState.DataBind();
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + ex.Message.ToString() + "')", true);
     }
 }
Ejemplo n.º 4
0
 protected void BindProgramsInfo()
 {
     try
     {
         DataTable dt = new DataTable();
         dt = objBL_Panels.BL_StateBind(objML_Panels);
         if (dt.Rows.Count > 0)
         {
             GrdState.DataSource = dt;
             GrdState.DataBind();
             lblGrid.Text = "";
         }
         else
         {
             lblGrid.Text = "No Data Found !";
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + ex.Message.ToString() + "');", true);
     }
 }