protected void Return_list_of_deployments_by_deploy_id() { DataTable dt = Guard_deployment.Return_list_of_deployments_by_deploy_id("return_list_of_deployments_by_deploy_id"); if (dt.Rows.Count > 0) { gdv_deployment_summary.DataSource = dt; gdv_deployment_summary.Columns["deploy_details_id"].Visible = false; gdv_deployment_summary.Columns["guard_name"].HeaderText = "Guard"; gdv_deployment_summary.Columns["branch_name"].HeaderText = "Branch"; gdv_deployment_summary.Columns["deploy_date"].HeaderText = "Date"; gdv_deployment_summary.Columns["deploy_type"].HeaderText = "D.Type"; gdv_deployment_summary.Columns["shift_type"].HeaderText = "Shift"; gdv_deployment_summary.Columns["deploy_date"].Width = 40; gdv_deployment_summary.Columns["guard_name"].Width = 110; gdv_deployment_summary.Columns["deploy_type"].Width = 50; gdv_deployment_summary.RowsDefaultCellStyle.BackColor = Color.LightGray; gdv_deployment_summary.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; // Set the row and column header styles. gdv_deployment_summary.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; gdv_deployment_summary.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; gdv_deployment_summary.RowHeadersDefaultCellStyle.BackColor = Color.Black; // Set the selection background color for all the cells. gdv_deployment_summary.DefaultCellStyle.SelectionBackColor = Color.Brown; gdv_deployment_summary.DefaultCellStyle.SelectionForeColor = Color.Black; foreach (DataGridViewColumn c in gdv_deployment_summary.Columns) { c.DefaultCellStyle.Font = new Font("Arial", 11F, GraphicsUnit.Pixel); } //set the background color of the header row gdv_deployment_summary.ColumnHeadersDefaultCellStyle.BackColor = Color.CadetBlue; gdv_deployment_summary.EnableHeadersVisualStyles = false; } }