Exemple #1
0
        protected void return_deployment_periods()
        {
            DataTable dt = Guard_deployment.Return_list_of_deployment_periods("return_list_of_deployment_periods");

            if (dt.Rows.Count > 0)
            {
                this.gdv_deployment_periods.DataSource = dt;
                this.gdv_deployment_periods.Columns["deploy_id"].Visible              = false;
                this.gdv_deployment_periods.Columns["deploy_start_date"].HeaderText   = "Deployment start date";
                this.gdv_deployment_periods.Columns["deploy_end_date"].HeaderText     = "Deployment end date";
                this.gdv_deployment_periods.Columns["created_by"].HeaderText          = "Created by";
                this.gdv_deployment_periods.Columns["active_deployment"].Visible      = false;
                this.gdv_deployment_periods.RowsDefaultCellStyle.BackColor            = Color.LightGray;
                this.gdv_deployment_periods.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
                this.gdv_deployment_periods.ColumnHeadersDefaultCellStyle.ForeColor   = Color.White;
                this.gdv_deployment_periods.ColumnHeadersDefaultCellStyle.BackColor   = Color.Black;
                this.gdv_deployment_periods.RowHeadersDefaultCellStyle.BackColor      = Color.Black;
                this.gdv_deployment_periods.DefaultCellStyle.SelectionBackColor       = Color.Cyan;
                this.gdv_deployment_periods.DefaultCellStyle.SelectionForeColor       = Color.Black;
                foreach (DataGridViewColumn c in this.gdv_deployment_periods.Columns)
                {
                    c.DefaultCellStyle.Font = new System.Drawing.Font("Arial", 11f, GraphicsUnit.Pixel);
                }
                this.gdv_deployment_periods.ColumnHeadersDefaultCellStyle.BackColor = Color.CadetBlue;
                this.gdv_deployment_periods.EnableHeadersVisualStyles = false;
            }
        }
        protected void return_deployment_periods()
        {
            DataTable dt = Guard_deployment.Return_list_of_deployment_periods("return_list_of_deployment_periods_for_accounts_reports_selector");

            if (dt.Rows.Count > 0)
            {
                DataRow dtRow = dt.NewRow();
                dtRow["deploy_id"] = -1;
                dtRow["period"]    = string.Empty;
                dt.Rows.InsertAt(dtRow, 0);
                this.cbo_deploy_period.DisplayMember = "period";
                this.cbo_deploy_period.ValueMember   = "deploy_id";
                this.cbo_deploy_period.DataSource    = dt;
            }
        }
        protected void return_deployment_periods()
        {
            DataTable dt = Guard_deployment.Return_list_of_deployment_periods("return_list_of_deployment_periods");

            if (dt.Rows.Count > 0)
            {
                gdv_deployment_periods.DataSource = dt;

                gdv_deployment_periods.Columns["deploy_id"].Visible = false;

                gdv_deployment_periods.Columns["deploy_start_date"].HeaderText = "Deployment start date";
                gdv_deployment_periods.Columns["deploy_end_date"].HeaderText   = "Deployment end date";
                gdv_deployment_periods.Columns["created_by"].HeaderText        = "Created by";
                gdv_deployment_periods.Columns["active_deployment"].HeaderText = "Active Deployment";

                gdv_deployment_periods.RowsDefaultCellStyle.BackColor            = Color.LightGray;
                gdv_deployment_periods.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;

                // Set the row and column header styles.
                gdv_deployment_periods.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
                gdv_deployment_periods.ColumnHeadersDefaultCellStyle.BackColor = Color.Black;
                gdv_deployment_periods.RowHeadersDefaultCellStyle.BackColor    = Color.Black;

                // Set the selection background color for all the cells.
                gdv_deployment_periods.DefaultCellStyle.SelectionBackColor = Color.Cyan;
                gdv_deployment_periods.DefaultCellStyle.SelectionForeColor = Color.Black;

                foreach (DataGridViewColumn c in gdv_deployment_periods.Columns)
                {
                    c.DefaultCellStyle.Font = new Font("Arial", 11F, GraphicsUnit.Pixel);
                }

                //set the background color of the header row
                gdv_deployment_periods.ColumnHeadersDefaultCellStyle.BackColor = Color.CadetBlue;
                gdv_deployment_periods.EnableHeadersVisualStyles = false;
            }
        }