How to include an icon in the column header in WinForms GridControl

11 Jun 20211 minute to read

The GridControl will allow you to place images in cells by specifying style.ImageIndex and style.ImageList value for the cell, provided style.CellType is either “Static” or “Text Box”. So, to make your header cell hold an icon, make it “Static” and set the following properties.

this.gridControl1[0,3].CellType = "Static";
this.gridControl1[0,3].CellAppearance = GridCellAppearance.Raised;
this.gridControl1[0,3].ImageList = this.imageList1; 
this.gridControl1[0,3].ImageIndex = 1;
Me.gridControl1(0,3).CellType = "Static"
Me.gridControl1(0,3).CellAppearance = GridCellAppearance.Raised
Me.gridControl1(0,3).ImageList = imageList
Me.gridControl1(0,3).ImageIndex = 1