Réponse acceptée !
'UN exemple, on suppose que ton datagrid s'appelle DGLISTE
Dim tableStyle As New DataGridTableStyle
tableStyle.MappingName = "[NOM DE TA TABLE]"
DgListe.TableStyles.Clear()
Dim titc As DataGridTextBoxColumn
'ICI, C'est ta colonne, tu en fais autant pour toutes tes colonnes
titc = New DataGridTextBoxColumn
titc.MappingName = "[NOM DU CHAMP DE BDD]"
titc.HeaderText = "[NOM QUE TU VEUX ATTRIBUER A L'ENTETE]"
tableStyle.GridColumnStyles.Add(titc)
titc = Nothing
'ET tu rajoutes à ta collection
DgListe.TableStyles.Add(tableStyle)
|