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 ArgilePosted Oct 19, 2008, 5:51 PM
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
KrutarthP PatelPosted Feb 27, 2010, 3:05 AM
Grant McConvillePosted Oct 20, 2008, 3:15 AM