Reputation:
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
Reputation: 178660
var myBoldFont = new Font(myBaseFont, FontStyle.Bold);
Datagrid.Rows[0].Cells[0].Style.Font = myBoldFont;
Upvotes: 3