Bonjour,
Je rencontre un Problème lors du remplissage de mon datagridview, seulement la cellule selectionné s'affiche et il faut que je click sur les autres cellules pour qu'elles apparaissent
Voici mon code
Voici le code généré par l'interface graphique
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 private void LSV_Client_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) { //Effacement du DataGridView Serie DGV_MFP.DataSource = null; DGV_MFP.DataMember = null; //Test si Header d'une colonne est selectionne /*if (DGV_MFP.CurrentRow == null) return;*/ if (e.Item.Text == null) return; //Requete string query = "SELECT MfpNumero \'Numero de Serie\', MfpType \'Modele\', ClientAdresse \'Adresse\', " + "ClientCodePostal \'C.P.\', ClientVille \'Ville\', DateLivraison \'Livraison\', " + "DateFinGarantie \'Fin de Garantie\' FROM multifonction WHERE ClientNom=\'" + e.Item.Text + "\' " + "ORDER BY DateLivraison ASC"; //Connexion MySQL ConnectToMySQL connect = new ConnectToMySQL(); //Resultat de la Recherche DataSet ds1 = connect.SelectDataSet(query); DGV_MFP.DataSource = ds1.Tables[0]; //Taille des Colonnes du DataGridView Serie this.DGV_MFP.Columns[0].Width = 50; this.DGV_MFP.Columns[1].Width = 50; this.DGV_MFP.Columns[3].Width = 50; this.DGV_MFP.Columns[4].Width = 70; this.DGV_MFP.Columns[5].Width = 70; this.DGV_MFP.Columns[6].Width = 70; }
Merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 // DGV_MFP // this.DGV_MFP.AllowUserToAddRows = false; this.DGV_MFP.AllowUserToDeleteRows = false; this.DGV_MFP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.DGV_MFP.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.DGV_MFP.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; this.DGV_MFP.BackgroundColor = System.Drawing.SystemColors.Control; this.DGV_MFP.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.DGV_MFP.Location = new System.Drawing.Point(286, 348); this.DGV_MFP.MultiSelect = false; this.DGV_MFP.Name = "DGV_MFP"; this.DGV_MFP.ReadOnly = true; this.DGV_MFP.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.DGV_MFP.ShowEditingIcon = false; this.DGV_MFP.Size = new System.Drawing.Size(898, 111); this.DGV_MFP.StandardTab = true; this.DGV_MFP.TabIndex = 5;
Partager