tags:

views:

231

answers:

1

Hi

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 ?

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

HTH, Kent

Kent Boogaart
Hi wat is myBaseFont here ? how can i create it ?