Format Class

Represents a format that can be applied to cells in a spreadsheet.

Inheritance

Object

Documents.Spreadsheet.Format

Namespace: Radzen.Documents.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public class Format

Constructors

Formatlink

Represents a format that can be applied to cells in a spreadsheet.

Declaration
public Format()

Properties

BackgroundColorlink

Gets or sets the background color of the format.

Declaration
public string BackgroundColor { get; set; }
Property Value
Type Description
stringGets or sets the background color of the format.

Boldlink

Gets or sets whether the text in the format should be bold.

Declaration
public bool Bold { get; set; }
Property Value
Type Description
boolGets or sets whether the text in the format should be bold.

BorderBottomlink

Gets or sets the bottom border style.

Declaration
public Documents.Spreadsheet.BorderStyle BorderBottom { get; set; }
Property Value
Type Description
Documents.Spreadsheet.BorderStyleGets or sets the bottom border style.

BorderLeftlink

Gets or sets the left border style.

Declaration
public Documents.Spreadsheet.BorderStyle BorderLeft { get; set; }
Property Value
Type Description
Documents.Spreadsheet.BorderStyleGets or sets the left border style.

BorderRightlink

Gets or sets the right border style.

Declaration
public Documents.Spreadsheet.BorderStyle BorderRight { get; set; }
Property Value
Type Description
Documents.Spreadsheet.BorderStyleGets or sets the right border style.

BorderToplink

Gets or sets the top border style.

Declaration
public Documents.Spreadsheet.BorderStyle BorderTop { get; set; }
Property Value
Type Description
Documents.Spreadsheet.BorderStyleGets or sets the top border style.

Colorlink

Gets or sets the color of the text in the format.

Declaration
public string Color { get; set; }
Property Value
Type Description
stringGets or sets the color of the text in the format.

FontFamilylink

Gets or sets the font family.

Declaration
public string FontFamily { get; set; }
Property Value
Type Description
stringGets or sets the font family.

FontSizelink

Gets or sets the font size in points.

Declaration
public double? FontSize { get; set; }
Property Value
Type Description
double?Gets or sets the font size in points.

FormulaHiddenlink

Gets or sets whether the cell's formula is hidden in the formula bar when sheet protection is active. Null means use the default (not hidden). Only takes effect when sheet protection is enabled.

Declaration
public bool? FormulaHidden { get; set; }
Property Value
Type Description
bool?Gets or sets whether the cell's formula is hidden in the formula bar when sheet protection is active. Null means use the default (not hidden). Only takes effect when sheet protection is enabled.

IsDefaultlink

Gets a value indicating whether all format properties are at their default values.

Declaration
public bool IsDefault { get; }
Property Value
Type Description
boolGets a value indicating whether all format properties are at their default values.

IsFormulaHiddenlink

Gets the effective formula hidden state (false if FormulaHidden is null).

Declaration
public bool IsFormulaHidden { get; }
Property Value
Type Description
boolGets the effective formula hidden state (false if FormulaHidden is null).

IsLockedlink

Gets the effective locked state (true if Locked is null, since XLSX defaults to locked).

Declaration
public bool IsLocked { get; }
Property Value
Type Description
boolGets the effective locked state (true if Locked is null, since XLSX defaults to locked).

Italiclink

Gets or sets whether the text in the format should be italicized.

Declaration
public bool Italic { get; set; }
Property Value
Type Description
boolGets or sets whether the text in the format should be italicized.

Lockedlink

Gets or sets whether the cell is locked when sheet protection is active. Null means use the default (locked). Only takes effect when sheet protection is enabled.

Declaration
public bool? Locked { get; set; }
Property Value
Type Description
bool?Gets or sets whether the cell is locked when sheet protection is active. Null means use the default (locked). Only takes effect when sheet protection is enabled.

NumberFormatlink

Gets or sets the number format code (e.g. "#,##0.00", "0%", "yyyy-mm-dd").

Declaration
public string NumberFormat { get; set; }
Property Value
Type Description
stringGets or sets the number format code (e.g. "#,##0.00", "0%", "yyyy-mm-dd").

Strikethroughlink

Gets or sets whether the text in the format should have a strikethrough.

Declaration
public bool Strikethrough { get; set; }
Property Value
Type Description
boolGets or sets whether the text in the format should have a strikethrough.

TextAlignlink

Gets or sets the text alignment in the format. Null means unset (default left).

Declaration
public TextAlign? TextAlign { get; set; }
Property Value
Type Description
TextAlign?Gets or sets the text alignment in the format. Null means unset (default left).

Underlinelink

Gets or sets whether the text in the format should be underlined.

Declaration
public bool Underline { get; set; }
Property Value
Type Description
boolGets or sets whether the text in the format should be underlined.

VerticalAlignlink

Gets or sets the vertical alignment in the format. Null means unset (default top).

Declaration
public VerticalAlign? VerticalAlign { get; set; }
Property Value
Type Description
VerticalAlign?Gets or sets the vertical alignment in the format. Null means unset (default top).

WrapTextlink

Gets or sets whether text should wrap within the cell.

Declaration
public bool WrapText { get; set; }
Property Value
Type Description
boolGets or sets whether text should wrap within the cell.

Methods

Clonelink

Creates a new instance of the Format class that is a copy of the current instance.

Declaration
public Documents.Spreadsheet.Format Clone()
Returns

WithBackgroundColorlink

This method is used to create a copy of the current format with a new background color.

Declaration
public Documents.Spreadsheet.Format WithBackgroundColor(string backgroundColor)
Parameters
Type Name Description
string backgroundColor
Returns

WithBoldlink

This method is used to create a copy of the current format with a new bold setting.

Declaration
public Documents.Spreadsheet.Format WithBold(bool bold)
Parameters
Type Name Description
bool bold
Returns

WithBorderslink

This method is used to create a copy of the current format with new border styles.

Declaration
public Documents.Spreadsheet.Format WithBorders(Documents.Spreadsheet.BorderStyle top, Documents.Spreadsheet.BorderStyle right, Documents.Spreadsheet.BorderStyle bottom, Documents.Spreadsheet.BorderStyle left)
Parameters
Returns

WithColorlink

This method is used to create a copy of the current format with a new color.

Declaration
public Documents.Spreadsheet.Format WithColor(string color)
Parameters
Type Name Description
string color
Returns

WithFontFamilylink

This method is used to create a copy of the current format with a new font family.

Declaration
public Documents.Spreadsheet.Format WithFontFamily(string fontFamily)
Parameters
Type Name Description
string fontFamily
Returns

WithFontSizelink

This method is used to create a copy of the current format with a new font size.

Declaration
public Documents.Spreadsheet.Format WithFontSize(double? fontSize)
Parameters
Type Name Description
double? fontSize
Returns

WithFormulaHiddenlink

Creates a copy of the current format with a new formula hidden setting.

Declaration
public Documents.Spreadsheet.Format WithFormulaHidden(bool? formulaHidden)
Parameters
Type Name Description
bool? formulaHidden
Returns

WithItaliclink

This method is used to create a copy of the current format with a new italic setting.

Declaration
public Documents.Spreadsheet.Format WithItalic(bool italic)
Parameters
Type Name Description
bool italic
Returns

WithLockedlink

Creates a copy of the current format with a new locked setting.

Declaration
public Documents.Spreadsheet.Format WithLocked(bool? locked)
Parameters
Type Name Description
bool? locked
Returns

WithNumberFormatlink

This method is used to create a copy of the current format with a new number format code.

Declaration
public Documents.Spreadsheet.Format WithNumberFormat(string numberFormat)
Parameters
Type Name Description
string numberFormat
Returns

WithStrikethroughlink

This method is used to create a copy of the current format with a new strikethrough setting.

Declaration
public Documents.Spreadsheet.Format WithStrikethrough(bool strikethrough)
Parameters
Type Name Description
bool strikethrough
Returns

WithTextAlignlink

This method is used to create a copy of the current format with a new text alignment setting.

Declaration
public Documents.Spreadsheet.Format WithTextAlign(TextAlign? textAlign)
Parameters
Type Name Description
TextAlign? textAlign
Returns

WithUnderlinelink

This method is used to create a copy of the current format with a new underline setting.

Declaration
public Documents.Spreadsheet.Format WithUnderline(bool underline)
Parameters
Type Name Description
bool underline
Returns

WithVerticalAlignlink

This method is used to create a copy of the current format with a new vertical alignment setting.

Declaration
public Documents.Spreadsheet.Format WithVerticalAlign(VerticalAlign? verticalAlign)
Parameters
Type Name Description
VerticalAlign? verticalAlign
Returns

WithWrapTextlink

This method is used to create a copy of the current format with a new wrap text setting.

Declaration
public Documents.Spreadsheet.Format WithWrapText(bool wrapText)
Parameters
Type Name Description
bool wrapText
Returns
An error has occurred. This app may no longer respond until reloaded. Reload 🗙