Datagridview - making a cell bold
I am not sure how I can find out weather a cell is bold or not, and then change it without effecting anything else such as italics, underline etc.
All I have at the moment is
foreach (DataGridViewCell cell in grid.SelectedCells)
{
cell.Style.Font = new Font(grid.Font, FontStyle.Bold);
}
grid is my datagridview.
I hope this is easy to understand, thanks

Ashley Argile97 reputationPosted Oct 19, 2008, 1:51 PM EDT
foreach (DataGridViewCell cell in dataGridView1.SelectedCells)
{
if (cell.InheritedStyle.Font.Bold)
cell.Style.Font = new Font(cell.InheritedStyle.Font, FontStyle.Regular);
else
cell.Style.Font = new Font(cell.InheritedStyle.Font, FontStyle.Bold);
}
regards
Ashley
Grant McConville18 reputationPosted Oct 19, 2008, 11:15 PM EDT
KrutarthP Patel2 reputationPosted Feb 26, 2010, 10:05 PM EST