public PO_MainScreen() { InitializeComponent(); sql = new MySQLDatabaseDriver(); poList = new ArrayList(); //ADJUST DATAGRIDVIEW COLUMN ALIGNMENT //Center column headers dgvPO.Columns["OrderDate"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvPO.Columns["DeliveryDate"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvPO.Columns["PONumber"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; //Center column contents dgvPO.Columns["OrderDate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvPO.Columns["DeliveryDate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvPO.Columns["PONumber"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; //TEST CODE (For the purpose of customizing the DGV and checking out its appearance) /*dgvPO.Rows.Add("09/24/2015", "09/30/2015", "Fat Shaolin Jaideite Kiosk", "BPO#1609-018", "Lucid Co."); * dgvPO.Rows.Add("11/30/2015", "12/30/2015", "St. Theresa School of Novaliches", "BPO#1611-002", "Fluora’s Shop"); * dgvPO.Rows.Add("09/30/2015", "10/30/2015", "Basic Co.", "BPO#1609-001", "Cinco Company"); * dgvPO.Rows.Add("08/23/2015", "09/15/2015", "Basic Co.", "BPO#1608-041", "Mayers Balay");*/ sql.SelectAllPODGV(dgvPO); dgvPO.Sort(dgvPO.Columns["PONumber"], ListSortDirection.Descending); //Sort datagridview by LATEST PO Number (Note: When you add a PO, it should appear at the top of the DGV) sql.SelectAllPO(poList); }