How to change a cell’s font to a particular font family

10 Jun 20211 minute to read

Use the FaceName property of the font property on the style object for the cell.

gridControl1[rowIndex, colIndex].Font.Facename = "Arial";

You can also change several font properties in one statement by using font class’s SetXXX method which, will return a reference to the font object.

//Snippet 1.  
gridControl1[rowIndex, colIndex].Font.Facename = "Arial";
gridControl1[rowIndex, colIndex].Font.Bold = true;
gridControl1[rowIndex, colIndex].Font.Size = 10;

//Snippet 2.
gridControl1[rowIndex, colIndex].Font.SetFacename("Arial").SetBold(true).SetSize(10);
'Snippet 1. 
gridControl1(rowIndex, colIndex).Font.Facename = "Arial"
gridControl1(rowIndex, colIndex).Font.Bold = 
gridControl1(rowIndex, colIndex).Font.Size = 10

'Snippet 2.
gridControl1(rowIndex, colIndex).Font.SetFacename("Arial").SetBold(True).SetSize(10)