Class RangeColumn
A class that represents a single column of cells.
Inherited Members
Namespace: IronXL
Assembly: IronXL.dll
Syntax
public class RangeColumn : Range
Properties
ColumnLetter
Gets the letter anme of the column.
Declaration
public string ColumnLetter { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ColumnNumber
0-based index of the column.
Declaration
public int ColumnNumber { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Hidden
Gets or sets a value indicating whether this column is hidden.
Declaration
public bool Hidden { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Width
Gets or sets the width of the column.
Declaration
public int Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
AutoSizeColumn()
Changes width of the column to fit the content. NOTE: This method measures the text in the cell based on the font that is used for the cell. If the exact font is not found on the machine it will try to measure it with a defalt font. If the default could not be found, it will try to use any font available. Finally if there are no fonts found the exception will be thrown.
Declaration
public void AutoSizeColumn()
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | |
| SixLabors.Fonts.FontException | Trown when no fonts found istalled on the machine. |
AutoSizeColumn(Boolean)
Changes width of the column to fit the content. NOTE: This method measures the text in the cell based on the font that is used for the cell. If the exact font is not found on the machine it will try to measure it with a defalt font. If the default could not be found, it will try to use any font available. Finally if there are no fonts found the exception will be thrown.
Declaration
public void AutoSizeColumn(bool useMergedCells)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | useMergedCells | If true, the width of merged cells will be taken into account. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | |
| SixLabors.Fonts.FontException | Trown when no fonts found istalled on the machine. |
RemoveColumn()
Removes the column from the worksheet.
Declaration
public void RemoveColumn()