private void populateCancelledFlightsGrid(DataGridView gridview) { DataTable past = FormDatabaseHelper.generateCancelledFlightsDataTable(USER.id); gridview.DefaultCellStyle.Format = "g"; gridview.DataSource = past; gridview.AutoGenerateColumns = false; gridview.Columns[0].Name = "Status"; // name gridview.Columns[0].HeaderText = "Status "; // header text gridview.Columns[0].DataPropertyName = "Status"; // field name gridview.Columns[1].Name = "OriginAbv"; // name gridview.Columns[1].HeaderText = "Origin "; // header text gridview.Columns[1].DataPropertyName = "OriginAbv"; // field name gridview.Columns[2].Name = "connectionAbv"; // name gridview.Columns[2].HeaderText = "Connection "; // header text gridview.Columns[2].DataPropertyName = "connectionAbv"; // field name gridview.Columns[3].Name = "finaldestAbv"; // name gridview.Columns[3].HeaderText = "Destination"; // header text gridview.Columns[3].DataPropertyName = "finaldestAbv"; // field name gridview.Columns[4].Name = "DepartureDate"; // name gridview.Columns[4].HeaderText = "Departure Origin"; // header text gridview.Columns[4].DataPropertyName = "DepartureDate"; // field name gridview.Columns[5].Name = "ArrivalDate"; // name gridview.Columns[5].HeaderText = "Arrival final Dest"; // header text gridview.Columns[5].DataPropertyName = "ArrivalDate"; // field name gridview.Columns[6].Name = "PaymentType"; // name gridview.Columns[6].HeaderText = "1- Card 2-Rewards"; // header text gridview.Columns[6].DataPropertyName = "PaymentType"; // field name gridview.Columns[7].Name = "PaymentAmount"; // name gridview.Columns[7].HeaderText = "Cost"; // header text gridview.Columns[7].DataPropertyName = "PaymentAmount"; // field name gridview.Columns[8].Name = "UserHistId"; // name gridview.Columns[8].HeaderText = "UserHist ID"; // header text gridview.Columns[8].DataPropertyName = "UserHistId"; // field name gridview.Columns[8].Visible = false; gridview.Columns[9].Visible = false; gridview.Columns[10].Visible = false; gridview.Columns[11].Visible = false; gridview.Columns[12].Visible = false; gridview.Columns[13].Visible = false; gridview.Columns[14].Visible = false; }