Represents a format that can be applied to cells in a spreadsheet.
Object
Namespace: Radzen.Documents.Spreadsheet
Assembly: Radzen.Blazor.dll
public class FormatRepresents a format that can be applied to cells in a spreadsheet.
public Format()Gets or sets the background color of the format.
public string BackgroundColor { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the background color of the format. |
Gets or sets whether the text in the format should be bold.
public bool Bold { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the text in the format should be bold. |
Gets or sets the bottom border style.
public Documents.Spreadsheet.BorderStyle BorderBottom { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.BorderStyle | Gets or sets the bottom border style. |
Gets or sets the left border style.
public Documents.Spreadsheet.BorderStyle BorderLeft { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.BorderStyle | Gets or sets the left border style. |
Gets or sets the right border style.
public Documents.Spreadsheet.BorderStyle BorderRight { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.BorderStyle | Gets or sets the right border style. |
Gets or sets the top border style.
public Documents.Spreadsheet.BorderStyle BorderTop { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.BorderStyle | Gets or sets the top border style. |
Gets or sets the color of the text in the format.
public string Color { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the color of the text in the format. |
Gets or sets the font family.
public string FontFamily { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the font family. |
Gets or sets the font size in points.
public double? FontSize { get; set; }
| Type | Description |
|---|---|
| double? | Gets or sets the font size in points. |
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.
public bool? FormulaHidden { get; set; }
| 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. |
Gets a value indicating whether all format properties are at their default values.
public bool IsDefault { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether all format properties are at their default values. |
Gets the effective formula hidden state (false if FormulaHidden is null).
public bool IsFormulaHidden { get; }
| Type | Description |
|---|---|
| bool | Gets the effective formula hidden state (false if FormulaHidden is null). |
Gets the effective locked state (true if Locked is null, since XLSX defaults to locked).
public bool IsLocked { get; }
| Type | Description |
|---|---|
| bool | Gets the effective locked state (true if Locked is null, since XLSX defaults to locked). |
Gets or sets whether the text in the format should be italicized.
public bool Italic { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the text in the format should be italicized. |
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.
public bool? Locked { get; set; }
| 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. |
Gets or sets the number format code (e.g. "#,##0.00", "0%", "yyyy-mm-dd").
public string NumberFormat { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the number format code (e.g. "#,##0.00", "0%", "yyyy-mm-dd"). |
Gets or sets whether the text in the format should have a strikethrough.
public bool Strikethrough { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the text in the format should have a strikethrough. |
Gets or sets the text alignment in the format. Null means unset (default left).
public TextAlign? TextAlign { get; set; }
| Type | Description |
|---|---|
| TextAlign? | Gets or sets the text alignment in the format. Null means unset (default left). |
Gets or sets whether the text in the format should be underlined.
public bool Underline { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the text in the format should be underlined. |
Gets or sets the vertical alignment in the format. Null means unset (default top).
public VerticalAlign? VerticalAlign { get; set; }
| Type | Description |
|---|---|
| VerticalAlign? | Gets or sets the vertical alignment in the format. Null means unset (default top). |
Gets or sets whether text should wrap within the cell.
public bool WrapText { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether text should wrap within the cell. |
Creates a new instance of the Format class that is a copy of the current instance.
public Documents.Spreadsheet.Format Clone()
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new background color.
public Documents.Spreadsheet.Format WithBackgroundColor(string backgroundColor)
| Type | Name | Description |
|---|---|---|
| string | backgroundColor |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new bold setting.
public Documents.Spreadsheet.Format WithBold(bool bold)
| Type | Name | Description |
|---|---|---|
| bool | bold |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with new border styles.
public Documents.Spreadsheet.Format WithBorders(Documents.Spreadsheet.BorderStyle top, Documents.Spreadsheet.BorderStyle right, Documents.Spreadsheet.BorderStyle bottom, Documents.Spreadsheet.BorderStyle left)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.BorderStyle | top | |
| Documents.Spreadsheet.BorderStyle | right | |
| Documents.Spreadsheet.BorderStyle | bottom | |
| Documents.Spreadsheet.BorderStyle | left |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new color.
public Documents.Spreadsheet.Format WithColor(string color)
| Type | Name | Description |
|---|---|---|
| string | color |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new font family.
public Documents.Spreadsheet.Format WithFontFamily(string fontFamily)
| Type | Name | Description |
|---|---|---|
| string | fontFamily |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new font size.
public Documents.Spreadsheet.Format WithFontSize(double? fontSize)
| Type | Name | Description |
|---|---|---|
| double? | fontSize |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
Creates a copy of the current format with a new formula hidden setting.
public Documents.Spreadsheet.Format WithFormulaHidden(bool? formulaHidden)
| Type | Name | Description |
|---|---|---|
| bool? | formulaHidden |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new italic setting.
public Documents.Spreadsheet.Format WithItalic(bool italic)
| Type | Name | Description |
|---|---|---|
| bool | italic |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
Creates a copy of the current format with a new locked setting.
public Documents.Spreadsheet.Format WithLocked(bool? locked)
| Type | Name | Description |
|---|---|---|
| bool? | locked |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new number format code.
public Documents.Spreadsheet.Format WithNumberFormat(string numberFormat)
| Type | Name | Description |
|---|---|---|
| string | numberFormat |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new strikethrough setting.
public Documents.Spreadsheet.Format WithStrikethrough(bool strikethrough)
| Type | Name | Description |
|---|---|---|
| bool | strikethrough |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new text alignment setting.
public Documents.Spreadsheet.Format WithTextAlign(TextAlign? textAlign)
| Type | Name | Description |
|---|---|---|
| TextAlign? | textAlign |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new underline setting.
public Documents.Spreadsheet.Format WithUnderline(bool underline)
| Type | Name | Description |
|---|---|---|
| bool | underline |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new vertical alignment setting.
public Documents.Spreadsheet.Format WithVerticalAlign(VerticalAlign? verticalAlign)
| Type | Name | Description |
|---|---|---|
| VerticalAlign? | verticalAlign |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |
This method is used to create a copy of the current format with a new wrap text setting.
public Documents.Spreadsheet.Format WithWrapText(bool wrapText)
| Type | Name | Description |
|---|---|---|
| bool | wrapText |
| Type | Description |
|---|---|
| Documents.Spreadsheet.Format |