Interface IStylable
Interface for indicating that certain Excel unit has it's own style
Namespace: IronXL.Styles
Assembly: IronXL.dll
Syntax
public interface IStylable
IStylable is the contract for anything in IronXL that carries a style. It declares a single Style property returning an IStyle, marking a type as something whose appearance, font, borders, fill, and alignment, can be read and set. It is the abstraction behind the styling surface a developer uses on cells and ranges.
The contract is reached through its one member rather than directly: the spreadsheet objects a developer works with expose a Style property of type IStyle, which is the shape IStylable defines. In practice that means reading Cell.Style or Range.Style to get the IStyle and assigning to its members. Because Style is get-only, styling is done by reading the property and setting the font, borders, and fill on the returned object rather than replacing the style wholesale.
using IronXL;
using IronXL.Styles;
WorkSheet sheet = WorkBook.Load("report.xlsx").DefaultWorkSheet;
IStyle style = sheet["A1"].Style;
style.Font.Bold = true;The style cells, borders, and fonts example demonstrates the styling surface, and the border and alignment how-to covers borders and layout through it.
Properties
Style
Cell style
Declaration
IStyle Style { get; }
Property Value
| Type | Description |
|---|---|
| IStyle |