2

I have a datagridview. I create datagridview column in .cs page. I want to add image in a datagridview column header.

DataGridViewCellStyle columnHeaderStyle = new DataGridViewCellStyle();
columnHeaderStyle.BackColor = Color.Beige;
columnHeaderStyle.Font = new Font("Bookman Old Style", 8, FontStyle.Bold);

datagridview1.ColumnHeadersDefaultCellStyle = columnHeaderStyle;
datagridview1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
datagridview1.ColumnCount = 2;            
datagridview1.Columns[0].HeaderText = "Details";
datagridview1.Columns[1].HeaderText = "Amount";

I want to add image in second column. That means "Amount(image)". How can I do this?

Humayun Shabbir
  • 2,961
  • 4
  • 20
  • 33
user3556223
  • 33
  • 2
  • 4

1 Answers1

-1

you have to store the images in a resource file, then you can pull from it.

Refer to below link for more details :

Datagridview Image Column Setting Image - C#

hope this helps..

Community
  • 1
  • 1
Sai Avinash
  • 4,683
  • 17
  • 58
  • 96