C# – How to make row in gridview bold and regular programatically

cgridview

Hi I have written program in c# outlook where u can send, receive, reply and forward the mails in text format through database I used gridview to retrieve the mails. But the new task is how to mark the unread message as bold and read message as regular in text.

help needed

Best Answer

You can loop through your rows by using.

DataGridViewCellStyle style = new DataGridViewCellStyle();
style.Font = new Font(dataGridView.Font, FontStyle.Bold);
foreach(DataGridViewRow dg_r in myDataGridView.rows) 
{
  dg_r.DefaultCellStyle = style; // sets Row Style to Bold
}