Interface IWorksheetCellFormat
Represents the format for the cell.
Namespace: Infragistics.Documents.Excel
Assembly: IgniteUI.Blazor.Documents.Excel.dll
Syntax
public interface IWorksheetCellFormat
Remarks
Depending on where the format is exposed, it will have a different meaning. For example, a cell's format just applies to itself, but a row or column's format applies to all cells in that row or column. There are also style formats, which can be the parent of other formats, meaning they provide defaults for values not set on the format. And finally, there are differential formats, such as the format for areas in a table, which provide default values for cells which exist in the associated area.
Properties
Alignment
Gets or sets the horizontal alignment of the content in a cell.
Declaration
HorizontalCellAlignment Alignment { get; set; }
Property Value
Type | Description |
---|---|
HorizontalCellAlignment | The horizontal alignment of the content in a cell. |
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the HorizontalCellAlignment enumeration. |
See Also
BottomBorderColorInfo
Gets or sets the bottom border color.
Declaration
WorkbookColorInfo BottomBorderColorInfo { get; set; }
Property Value
Type | Description |
---|---|
WorkbookColorInfo | The bottom border color. |
Remarks
If the border color is set to a non-default value and the BottomBorderStyle is set to Default, it will be resolved to Thin.
See Also
BottomBorderStyle
Gets or sets the bottom border style.
Declaration
CellBorderLineStyle BottomBorderStyle { get; set; }
Property Value
Type | Description |
---|---|
CellBorderLineStyle | The bottom border style. |
Remarks
If the border style is set to a non-default value and the BottomBorderColorInfo is null, it will be resolved to Automatic.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the CellBorderLineStyle enumeration. |
See Also
DiagonalBorderColorInfo
Gets or sets the diagonal border color.
Declaration
WorkbookColorInfo DiagonalBorderColorInfo { get; set; }
Property Value
Type | Description |
---|---|
WorkbookColorInfo | The diagonal border color. |
Remarks
If the border color is set to a non-default value and the DiagonalBorderStyle is set to Default, it will be resolved to Thin.
See Also
DiagonalBorders
Gets or sets the diagonal borders.
Declaration
DiagonalBorders DiagonalBorders { get; set; }
Property Value
Type | Description |
---|---|
DiagonalBorders | The diagonal border style. |
Remarks
If the diagonal borders are set to something other than None and the DiagonalBorderStyle is set to Default, it will be resolved to Thin. Similarly, if the DiagonalBorderColorInfo is null, it will be resolved to Color.Black.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the CellBorderLineStyle enumeration. |
See Also
DiagonalBorderStyle
Gets or sets the diagonal border style.
Declaration
CellBorderLineStyle DiagonalBorderStyle { get; set; }
Property Value
Type | Description |
---|---|
CellBorderLineStyle | The diagonal border style. |
Remarks
If the border style is set to a non-default value and the DiagonalBorderColorInfo is null, it will be resolved to Automatic.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the CellBorderLineStyle enumeration. |
See Also
Fill
Gets or sets the fill of the cell.
Declaration
CellFill Fill { get; set; }
Property Value
Type | Description |
---|---|
CellFill | The fill of the cell. |
See Also
Font
Gets or sets the default font formatting.
Declaration
IWorkbookFont Font { get; }
Property Value
Type | Description |
---|---|
IWorkbookFont | The default font formatting. |
Remarks
This font formatting is just the default font used in the cell. This can be overridden by strings on a character by character basis by using the FormattedString class.
FormatOptions
Gets or sets the groups of properties provided by the format.
Declaration
WorksheetCellFormatOptions FormatOptions { get; set; }
Property Value
Type | Description |
---|---|
WorksheetCellFormatOptions |
Remarks
For style formats, this value indicates which properties should be used in the format when applying the style to a cell. All other groups of properties will return a default value.
For cell and differential formats, this value indicates which properties should be resolved and returned by the format. All other properties should will be resolved and returned by the parent Style.
See Also
FormatString
Gets or sets the number format string.
Declaration
string FormatString { get; set; }
Property Value
Type | Description |
---|---|
System.String | The number format string. |
Remarks
For more information on excel format strings, consult Microsoft Excel help.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The assigned value is an invalid format string and ValidateFormatStrings is True. |
See Also
Hidden
Declaration
ExcelDefaultableBoolean Hidden { get; set; }
Property Value
Type | Description |
---|---|
ExcelDefaultableBoolean |
Indent
Gets or sets the indent in units of average character widths.
Declaration
int Indent { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The indent in units of average character widths or -1 to use the default indent. |
Remarks
A value of -1 indicates that the default value should be used.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | The assigned value is not -1 and is outside the valid indent level range of 0 and 250. |
LeftBorderColorInfo
Gets or sets the left border color.
Declaration
WorkbookColorInfo LeftBorderColorInfo { get; set; }
Property Value
Type | Description |
---|---|
WorkbookColorInfo | The left border color. |
Remarks
If the border color is set to a non-default value and the LeftBorderStyle is set to Default, it will be resolved to Thin.
See Also
LeftBorderStyle
Gets or sets the left border style.
Declaration
CellBorderLineStyle LeftBorderStyle { get; set; }
Property Value
Type | Description |
---|---|
CellBorderLineStyle | The left border style. |
Remarks
If the border style is set to a non-default value and the LeftBorderColorInfo is null, it will be resolved to Automatic.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the CellBorderLineStyle enumeration. |
See Also
Locked
Gets or sets the valid which indicates whether the cell is locked in protected mode.
Declaration
ExcelDefaultableBoolean Locked { get; set; }
Property Value
Type | Description |
---|---|
ExcelDefaultableBoolean | The valid which indicates whether the cell is locked in protected mode. |
Remarks
The Locked valid is used in Excel file only if the associated Worksheet or Workbook is protected. Otherwise the value is ignored.
See Also
RightBorderColorInfo
Gets or sets the right border color.
Declaration
WorkbookColorInfo RightBorderColorInfo { get; set; }
Property Value
Type | Description |
---|---|
WorkbookColorInfo | The right border color. |
Remarks
If the border color is set to a non-default value and the RightBorderStyle is set to Default, it will be resolved to Thin.
See Also
RightBorderStyle
Gets or sets the right border style.
Declaration
CellBorderLineStyle RightBorderStyle { get; set; }
Property Value
Type | Description |
---|---|
CellBorderLineStyle | The right border style. |
Remarks
If the border style is set to a non-default value and the RightBorderColorInfo is null, it will be resolved to Automatic.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the CellBorderLineStyle enumeration. |
See Also
Rotation
Gets or sets the rotation of the cell content in degrees.
Declaration
int Rotation { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The rotation of the cell content in degrees. |
Remarks
Cell text rotation, in degrees; 0 – 90 is up 0 – 90 degrees, 91 – 180 is down 1 – 90 degrees, and 255 is vertical.
ShrinkToFit
Gets or sets the value indicating whether the cell content will shrink to fit the cell.
Declaration
ExcelDefaultableBoolean ShrinkToFit { get; set; }
Property Value
Type | Description |
---|---|
ExcelDefaultableBoolean | The value indicating whether the cell content will shrink to fit the cell. |
Remarks
If True, the size of the cell font will shrink so all data fits within the cell.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the ExcelDefaultableBoolean enumeration. |
Style
Gets or sets the parent WorkbookStyle of the format.
Declaration
WorkbookStyle Style { get; set; }
Property Value
Type | Description |
---|---|
WorkbookStyle | A WorkbookStyle instance if this is a cell or differential format, or null if this is a style format. |
Remarks
The parent style of a cell or differential format provides default format values. Depending on which FormatOptions flags are present, only certain groups of format properties will be resolved from parent style. When any of the properties in a group is set to a non-default value, the FormatOptions will automatically have that flag included so the format provides values in that group rather than the style providing values in that group.
By default, all cell and differential formats will have a parent style of the normal style, which is exposed by the NormalStyle property. If a value of null is assigned as the Style for a cell or differential format, then NormalStyle will actually be set.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The value assigned is non-null and the format is a style format. |
System.ArgumentException | The value assigned is from a different Workbook. |
See Also
TopBorderColorInfo
Gets or sets the top border color.
Declaration
WorkbookColorInfo TopBorderColorInfo { get; set; }
Property Value
Type | Description |
---|---|
WorkbookColorInfo | The top border color. |
Remarks
If the border color is set to a non-default value and the TopBorderStyle is set to Default, it will be resolved to Thin.
See Also
TopBorderStyle
Gets or sets the top border style.
Declaration
CellBorderLineStyle TopBorderStyle { get; set; }
Property Value
Type | Description |
---|---|
CellBorderLineStyle | The top border style. |
Remarks
If the border style is set to a non-default value and the TopBorderColorInfo is null, it will be resolved to Automatic.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the CellBorderLineStyle enumeration. |
See Also
VerticalAlignment
Gets or sets the vertical alignment of the content in a cell.
Declaration
VerticalCellAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
VerticalCellAlignment | The vertical alignment of the content in a cell. |
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the VerticalCellAlignment enumeration. |
See Also
WrapText
Gets or sets the value which indicates whether text will wrap in a cell.
Declaration
ExcelDefaultableBoolean WrapText { get; set; }
Property Value
Type | Description |
---|---|
ExcelDefaultableBoolean | The value which indicates whether text will wrap in a cell. |
Remarks
If True, and the row associated with the cell has a default Height, the row's height will automatically be increased to fit wrapped content.
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not defined in the ExcelDefaultableBoolean enumeration. |
Methods
SetFormatting(IWorksheetCellFormat)
Copies all cell format properties to from the specified cell format.
Declaration
void SetFormatting(IWorksheetCellFormat source)
Parameters
Type | Name | Description |
---|---|---|
IWorksheetCellFormat | source | The cell format from which to copy the properties. |