Class GridCells

GridCells class

Encapsulates a collection of Cell objects.

public class GridCells : IEnumerable

Properties

NameDescription
Columns { get; }
Count { get; }Gets the number of cells.
FirstCell { get; }
Item { get; }Gets the GridCell element at the specified cell row index and column index. (2 indexers)
LastCell { get; }
MaxColumn { get; }Maximum column index of cell which contains data or style.
MaxDataColumn { get; }Maximum column index of cell which contains data.
MaxDataRow { get; }Maximum row index of cell which contains data.
MaxRow { get; }Maximum row index of cell which contains data or style.
MergedCells { get; }Gets the collection of merged cells.
MinColumn { get; }Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
MinDataColumn { get; }Minimum column index of cell which contains data.
MinDataRow { get; }Minimum row index of cell which contains data.
MinRow { get; }Minimum row index of cell which contains data or style.
RowEnumerator { get; }Gets the rows enumerator
Rows { get; }Gets the collection of GridRow objects that represents the individual rows in this worksheet.
StandardHeight { get; set; }Gets or sets the default row height in this worksheet,in unit of points.
StandardHeightPixels { get; set; }Gets or sets the default row height in this worksheet,in unit of pixels.
StandardWidth { get; set; }Gets or sets the default column width in the worksheet,in unit of characters.
StandardWidthInch { get; set; }
StandardWidthPixels { get; set; }

Methods

NameDescription
CheckCell(int, int)Gets the GridCell element or null at the specified cell row index and column index.
Clear()Clear all cells in the collection.
ClearContents(GridCellArea)Clears contents of a range.
ClearContents(int, int, int, int)Clears contents of a range.
ClearFormats(GridCellArea)Clears formatting of a range.
ClearFormats(int, int, int, int)Clears formatting of a range.
ClearRange(GridCellArea)Clears contents and formatting of a range.
ClearRange(int, int, int, int)Clears contents and formatting of a range.
CopyColumn(GridCells, int, int)Copies data and formattings of a whole column.
CopyColumns(GridCells, int, int, int)Copies data and formattings of a whole column.
CopyRow(GridCells, int, int)Copies data and formattings of a whole row.
CopyRows(GridCells, int, int, int)Copies data and formattings of some whole rows.
DeleteBlankColumns()Delete all blank columns which do not contain any data.
DeleteBlankRows()Delete all blank rows which do not contain any data.
DeleteColumn(int)Deletes a column.
DeleteColumn(int, bool)Deletes a column.
DeleteColumns(int, int, bool)Deletes several columns.
DeleteRow(int)Deletes a row.
DeleteRows(int, int)Deletes several rows.
DeleteRows(int, int, bool)Deletes multiple rows in the worksheet.
GetCell(int, int)Gets the GridCell element or null at the specified cell row index and column index.
GetCellStyle(int, int)Get the style of given cell.
GetColumn(int)Gets the GridColumn element or at the specified cell column index.
GetColumnWidth(int)Gets the width of the specified column
GetColumnWidthInch(int)Gets the width of the specified column, in units of inches.
GetColumnWidthPixel(int)Gets the width of the specified column, in units of pixel.
GetEnumerator()Gets the rows enumerator
GetRow(int)Gets the GridRow element or at the specified cell row index.
GetRowHeight(int)Gets the height of a specified row.
GetRowHeightInch(int)Gets the height of a specified row in unit of inches.
GetRowHeightPixel(int)Gets the height of a specified row in unit of pixel.
GetViewColumnWidthPixel(int)Get the width in different view type.
GroupColumns(int, int)Groups columns.
GroupColumns(int, int, bool)Groups columns.
GroupRows(int, int)Groups rows.
HideColumn(int)Hides a column.
HideColumns(int, int)Hide multiple columns.
HideRow(int)Hides a row.
HideRows(int, int)Hides multiple rows.
InsertColumn(int)Inserts a new column into the worksheet.
InsertColumn(int, bool)Inserts a new column into the worksheet.
InsertColumns(int, int)Inserts some columns into the worksheet.
InsertColumns(int, int, bool)Inserts some columns into the worksheet.
InsertRow(int)Inserts a new row into the worksheet.
InsertRows(int, int)Inserts multiple rows into the worksheet.
InsertRows(int, int, bool)Inserts multiple rows into the worksheet.
IsBlankColumn(int)Checks whether given column is blank(does not contain any data).
IsColumnHidden(int)Checks whether a column at given index is hidden.
IsRowHidden(int)Checks whether a row at given index is hidden.
Merge(int, int, int, int)Merges a specified range of cells into a single cell.
RemoveFormulas()Removes all formula and replaces with the value of the formula.
SetColumnWidth(int, double)Sets the width of the specified column.
SetColumnWidthInch(int, double)Sets column width in unit of inches.
SetColumnWidthPixel(int, int)Sets column width in unit of pixels.
SetRowHeight(int, double)Sets the height of the specified row.
SetRowHeightInch(int, double)Sets row height in unit of inches.
SetRowHeightPixel(int, int)Sets row height in unit of pixels.
SetStyle(CellRange, Style)Sets the style to a specified range of cells.
SetStyle(string, Style)Sets the style to a specified range of cells.
SetStyle(int, int, int, int, Style)Sets the style to a specified range of cells.
Sort(int, int, int, int, int, bool, bool, bool)Sorts the datas ascend/decend top to bottom in a range of a Worksheet by specified column index. Sorts the datas ascend/decend left to right in a range of a Worksheet by specified row index.
Sort(int, int, int, int, int[], SortOrder[], SortOrientation, bool)Sorts the data of the area.
SortAsNumber(int, int, int, int, int[], SortOrder[], SortOrientation)Sorts the data of the area (the key column data shall be number).
UngroupColumns(int, int)Ungroups columns.
UngroupRows(int, int)Ungroups rows.
UnhideColumn(int, double)Unhides a column
UnhideColumns(int, int, double)Unhide multiple columns.
UnhideRow(int, int)Unhides a row.
UnhideRows(int, int, double)Unhides the hidden rows.
UnMerge(int, int, int, int)Unmerges a specified range of merged cells.
static CellIndexToName(int, int)Gets cell name according to its row and column indexes.
static CellNameToIndex(string, out int, out int)Gets the cell row and column indexes according to its name
static ColumnIndexToName(int)Gets column name according to column index.
static ColumnNameToIndex(string)Gets column index according to column name.

See Also