Reputation: 11
Hi i have a XLCell and need to validate if that cell have Bold style.
IXLCell cell = worksheet.Cell(12, 5);
if (cell.Style.Font.Bold)
{
callFunction();
}
Open xlsx the cell have the Bold style active. Using c# and closedXml how can i validate if cell have bold style active? Should be with other properties or styles?
Thks in advance
Upvotes: 1
Views: 5761
Reputation: 3633
cell.Style.Font.Bold is a property with both a get and a set method so you should be able to do the following:
IXLCell = worksheet.Cell(12, 5);
if (cell.Style.Font.Bold == true)
{
callFunction();
}
Check out the ClosedXML Documentation for more details.
Upvotes: 2