Beispiel #1
0
        public void grdfill()
        {
            try
            {
                // DataTable dt = new DataTable();

                dtTimezone.Clear();
                objData = new MasterData();
                dtTimezone = new DataTable();
                dtTimezone = objData.GetTimezone(null);
                if (dtTimezone.Rows.Count > 0)
                {
                    grdTimezone.DataSource = dtTimezone;
                    grdTimezone.DataBind();
                }
                else
                {
                    foreach (DataColumn cl in dtTimezone.Columns)
                    {
                        cl.AllowDBNull = true;
                    }
                    dtTimezone.Rows.Add(dtTimezone.NewRow());
                    grdTimezone.DataSource = dtTimezone;
                    grdTimezone.DataBind();
                    int columncount = grdTimezone.Rows[0].Cells.Count;
                    grdTimezone.Rows[0].Cells.Clear();
                    grdTimezone.Rows[0].Cells.Add(new TableCell());
                    grdTimezone.Rows[0].Cells[0].ColumnSpan = columncount - 2;
                    grdTimezone.Rows[0].Cells[0].Text = "No Records Found";
                    grdTimezone.Columns[columncount - 2].Visible = false;
                }
                grdTimezone.FooterRow.Visible = true;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Beispiel #2
0
 public void filltimezone()
 {
     MasterData objmst = new MasterData();
     DataTable dt = objmst.GetTimezone("Y");
     ddltimezone.DataSource = dt;
     ddltimezone.DataValueField = "TIMEZONE_ID";
     ddltimezone.DataTextField = "TIMEZONE_DESC";
     ddltimezone.DataBind();
     ddltimezone.Items.Insert(0, new ListItem { Value = "0", Text = "--Select--", Selected = true });
 }