How can I quickly put borders on all the cells in a sheet?
I have tried this, but I’m not getting the results I want:
for (int i = 0; i < WorkBook.Styles.Count; i++)
{
SetBorders(WorkBook.Styles[i]);
}
private void SetBorders(Style style)
{
style.SetBorder(BorderType.LeftBorder, CellBorderType.Medium, Color.Black);
style.SetBorder(BorderType.RightBorder, CellBorderType.Medium, Color.Black);
style.SetBorder(BorderType.TopBorder, CellBorderType.Medium, Color.Black);
style.SetBorder(BorderType.BottomBorder, CellBorderType.Medium, Color.Black);
}This seems to only affect the styles that I have created.