Senthil
Senthil

Reputation:

How to display a text as bold in a datagrid?

I am using a datagrid in window application c#.net. I want to display a text as bold dynamically.

Using the below code i am getting the error font.bold is only read only.

Datagrid.Rows[0].Cells[0].Style.Font.Bold = true;

Is there anyother way displaying a text dynamically in a datagrid ?

Upvotes: 2

Views: 3518

Answers (1)

Kent Boogaart
Kent Boogaart

Reputation: 178660

var myBoldFont = new Font(myBaseFont, FontStyle.Bold);
Datagrid.Rows[0].Cells[0].Style.Font = myBoldFont;

Upvotes: 3

Related Questions