Bonjour,
J'ai un datagridview alimenté par un datatable.
J'ai certaines colonnes qui sont de type "String" et je voudrais les passer en type "DataGridViewImageColumn".
J'utilise l'événement CellFormating :
LE soucis c'est que lorsque ma grille s'affiche, elle m'affiche dans les colonnes "System.Drawing.Bitmap".
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 private void dgvPlanificationCalendaire_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.RowIndex >= 0) { if (e.ColumnIndex == 3) { System.Windows.Forms.DataGridViewImageColumn btDateN = new System.Windows.Forms.DataGridViewImageColumn(); btDateN.Image = global::GestAMI.Properties.Resources.b_calendrier; dgvPlanificationCalendaire[e.ColumnIndex, e.RowIndex].ValueType = typeof(System.Drawing.Image); dgvPlanificationCalendaire[e.ColumnIndex, e.RowIndex].Value = btDateN.Image; } } }
Je n'arrive pas à cerner le problème.
Merci de votre aide
Partager