public void LoadData() { //initializing the lists for the dropdown field List <string> lstWines; List <string> listAlerts; //clearing already present data comboAlertOUT.Items.Clear(); comboWineChoice.Items.Clear(); //list for all wines in "add an alert" lstWines = req.GetListWines(); for (int i = 0; i < lstWines.Count; i++) { comboWineChoice.Items.Add(lstWines[i].ToString()); } //list for all alerts in "remove an alert" listAlerts = req.GetListAlerts(); for (int i = 0; i < listAlerts.Count; i++) { comboAlertOUT.Items.Add(listAlerts[i].ToString()); } grpAddAlert.Show(); grpDel.Hide(); dvgAlerts.ColumnCount = 3; //option for display dvgAlerts.ColumnHeadersDefaultCellStyle.BackColor = Color.Navy; dvgAlerts.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; dvgAlerts.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dvgAlerts.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; dvgAlerts.CellBorderStyle = DataGridViewCellBorderStyle.Single; dvgAlerts.GridColor = Color.Black; //columns name dvgAlerts.Columns[0].Name = "Nom de l'alerte"; dvgAlerts.Columns[1].Name = "Message de l'alerte"; dvgAlerts.Columns[2].Name = "Bouteilles associƩes"; dvgAlerts.Columns[0].Width = 130; dvgAlerts.Rows.Clear(); List <Alerts> lstAlert = Alerts.ShowAllAlerts(); foreach (Alerts alert in lstAlert) { string[] row = { alert.Name, alert.Message, alert.LinkedBottles }; dvgAlerts.Rows.Add(row); } }