ig.excel.WorksheetCell

Represents a cell in a Microsoft Excel worksheet.

Dependencies

jquery-1.4.4.js
infragistics.util.js
The current widget has no options.
The current widget has no events.
  • applyFormula

    .applyFormula( value:string );

    Applies a formula to the cell.

    • value
    • Type:string
    • The formula to parse and apply to the cell.

    Exceptions

    Exception Description
    ig.ArgumentNullException value is null or empty.
    ig.excel.FormulaParseException value is not a valid formula.
    ig.InvalidOperationException The cell is part of an array formula or data table which is not confined to just the cell.

    Remarks

    value is parsed based on the CellReferenceMode of the Workbook to which the cell belongs. If the cell's WorksheetCell.worksheet has been removed from its parent collection, the A1 CellReferenceMode will be used to parse the formula.

    Note: it is slightly faster to use the WorksheetRow.applyCellFormula method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.ApplyCellFormula method.

  • associatedDataTable

    .associatedDataTable( );
    Return Type:
    ig.excel.WorksheetDataTable
    Return Type Description:
    The data table to which the cell belongs or null if the cell does not belong to a data table.

    Gets the data table to which the cell belongs.

    Remarks

    The cells in the left-most column and top-most row of the data table will return null for the associated data table.

    If a data table is associated with the cell, getting the WorksheetCell.value will return the calculated value for the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellAssociatedDataTable method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellAssociatedDataTable method.

  • associatedMergedCellsRegion

    .associatedMergedCellsRegion( );
    Return Type:
    ig.excel.WorksheetMergedCellsRegion
    Return Type Description:
    The merged cells region which contains the cell, or null if the cell is not merged.

    Gets the merged cells region which contains the cell, or null if the cell is not merged.

    Remarks

    Note: it is slightly faster to use the WorksheetRow.getCellAssociatedMergedCellsRegion method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellAssociatedMergedCellsRegion method.

  • associatedTable

    .associatedTable( );

    Gets the WorksheetTable to which this cell belongs.

    Remarks

    A cell belongs to a table if it exists in any area of the table. It can be a header cell, total cell, or a cell in the data area.

    Note: it is slightly faster to use the WorksheetRow.getCellAssociatedTable method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellAssociatedTable method.

  • cellFormat

    .cellFormat( );
    Return Type:
    ig.excel.IWorksheetCellFormat
    Return Type Description:
    The cell formatting for this cell.

    Gets the cell formatting for this cell.

    Remarks

    Use this property to set cell formatting specific to the cell. If you will be applying the format to numerous cells, see the Workbook.createNewWorksheetCellFormat method for performance considerations.

    If this cell belongs to a merged cell region, getting the CellFormat will get the CellFormat of the associated merged cell region.

    Note: it is slightly faster to use the WorksheetRow.getCellFormat method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellFormat method.

  • clearComment

    .clearComment( );

    Removes the comment associated with the cell.

    Remarks

    Note: it is slightly faster to use the WorksheetRow.setCellComment method and pass in null as the comment parameter, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.SetCellComment method and passing in null as the comment parameter.

  • columnIndex

    .columnIndex( );
    Return Type:
    number
    Return Type Description:
    The column index of the cell.

    Gets the column index of the cell.

  • comment

    .comment( );
    Return Type:
    ig.excel.WorksheetCellComment
    Return Type Description:
    The comment applied to the cell.

    Gets the comment applied to the cell.

    Exceptions

    Exception Description
    ig.InvalidOperationException The value applied only has only one anchor cell set. It should have both or neither anchor cells set.
    ig.InvalidOperationException The value has its WorksheetShape.topLeftCornerCell and WorksheetShape.bottomRightCornerCell anchors set but they are from different worksheets.

    Remarks

    Note: it is slightly faster to use the WorksheetRow.getCellComment or WorksheetRow.setCellComment methods, which do not create WorksheetCell instances internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment or WorksheetRow.SetCellComment methods.

  • comment

    .comment( value:ig.excel.WorksheetCellComment );
    Return Type:
    ig.excel.WorksheetCellComment
    Return Type Description:
    The comment applied to the cell.

    Sets the comment applied to the cell.

    • value
    • Type:ig.excel.WorksheetCellComment

    Exceptions

    Exception Description
    ig.InvalidOperationException The value applied only has only one anchor cell set. It should have both or neither anchor cells set.
    ig.InvalidOperationException The value has its WorksheetShape.topLeftCornerCell and WorksheetShape.bottomRightCornerCell anchors set but they are from different worksheets.

    Remarks

    Note: it is slightly faster to use the WorksheetRow.getCellComment or WorksheetRow.setCellComment methods, which do not create WorksheetCell instances internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment or WorksheetRow.SetCellComment methods.

  • dataValidationRule

    .dataValidationRule( );

    Gets the data validation rule for the WorksheetCell.

    Exceptions

    Exception Description
    ig.ArgumentException Occurs when the value specified is already applied to cells in another worksheet.
    ig.ArgumentException Occurs when the value specified is invalid based on its rule type's requirements.
  • dataValidationRule

    .dataValidationRule( value:ig.excel.DataValidationRule );

    Sets the data validation rule for the WorksheetCell.

    • value
    • Type:ig.excel.DataValidationRule

    Exceptions

    Exception Description
    ig.ArgumentException Occurs when the value specified is already applied to cells in another worksheet.
    ig.ArgumentException Occurs when the value specified is invalid based on its rule type's requirements.
  • equals

    .equals( obj:object );
    Return Type:
    boolean
    Return Type Description:
    True if the cells refer to the same location on the same worksheet; False otherwise.

    Determines whether the specified object is another WorksheetCell instance which refers to the same location on the same worksheet as this cell.

    • obj
    • Type:object
    • The instance to check for equality.
  • formula

    .formula( );
    Return Type:
    ig.excel.Formula
    Return Type Description:
    The formula which has been applied to the cell or null if no formula has been applied.

    Gets the formula which has been applied to the cell.

    Remarks

    If a formula has been applied to the cell, getting the WorksheetCell.value will return the calculated value of the formula.

    Note: it is slightly faster to use the WorksheetRow.getCellFormula method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellFormula method.

  • getBoundsInTwips

    .getBoundsInTwips( );
    Return Type:
    object
    Return Type Description:
    The bounds of the cell on its worksheet. This will be an object with numeric values for properties 'x', 'y', 'width', 'height', 'left', 'top', 'right', and 'bottom'.

    Gets the bounds of the cell in twips (1/20th of a point).

    Remarks

    The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the cell are resized, these bounds will no longer reflect the position of the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellBoundsInTwips method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.GetBoundsInTwips method.

  • getBoundsInTwips

    .getBoundsInTwips( options:ig.excel.PositioningOptions );
    Return Type:
    object
    Return Type Description:
    The bounds of the cell on its worksheet. This will be an object with numeric values for properties 'x', 'y', 'width', 'height', 'left', 'top', 'right', and 'bottom'.

    Gets the bounds of the cell in twips (1/20th of a point).

    • options
    • Type:ig.excel.PositioningOptions
    • The options to use when getting the bounds of the cell.

    Remarks

    The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the cell are resized, these bounds will no longer reflect the position of the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellBoundsInTwips method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.GetBoundsInTwips method.

  • getCellAddressString

    .getCellAddressString( worksheetRow:ig.excel.WorksheetRow, columnIndex:number, cellReferenceMode:ig.excel.CellReferenceMode, includeWorksheetName:boolean );
    Return Type:
    string
    Return Type Description:
    The string representation of the address of the cell.

    Gets the string representation of the address of the cell.

    • worksheetRow
    • Type:ig.excel.WorksheetRow
    • The WorksheetRow of the cell.
    • columnIndex
    • Type:number
    • The index of the column of the cell.
    • cellReferenceMode
    • Type:ig.excel.CellReferenceMode
    • The mode used to generate cell references.
    • includeWorksheetName
    • Type:boolean
    • The value indicating whether to include the worksheet name in the cell address.
  • getCellAddressString

    .getCellAddressString( worksheetRow:ig.excel.WorksheetRow, columnIndex:number, cellReferenceMode:ig.excel.CellReferenceMode, includeWorksheetName:boolean, useRelativeColumn:boolean, useRelativeRow:boolean );
    Return Type:
    string
    Return Type Description:
    The string representation of the address of the cell.

    Gets the string representation of the address of the cell.

    • worksheetRow
    • Type:ig.excel.WorksheetRow
    • The WorksheetRow of the cell.
    • columnIndex
    • Type:number
    • The index of the column of the cell.
    • cellReferenceMode
    • Type:ig.excel.CellReferenceMode
    • The mode used to generate cell references.
    • includeWorksheetName
    • Type:boolean
    • The value indicating whether to include the worksheet name in the cell address.
    • useRelativeColumn
    • Type:boolean
    • The value indicating whether to use a relative column address.
    • useRelativeRow
    • Type:boolean
    • The value indicating whether to use a relative row address.
  • getHashCode

    .getHashCode( );
    Return Type:
    number
    Return Type Description:
    The hash code of the <a href="ig.excel.WorksheetCell.html">WorksheetCell</a>.

    Gets the hash code of the WorksheetCell.

  • getHyperlink

    .getHyperlink( );

    Gets the effective hyperlink on the cell.

    Remarks

    If multiple hyperlinks are applied to the cell, the last one in the Worksheet.hyperlinks collection will be used.

    If the cell has one or more hyperlinks in the Worksheet.hyperlinks collection as well as a formula containing a HYPERLINK function, the last hyperlink from the collection will be used.

    If the cell has a hyperlink due to the HYPERLINK function being used in a formula, the returned value will be sealed.

  • getResolvedCellFormat

    .getResolvedCellFormat( );
    Return Type:
    ig.excel.IWorksheetCellFormat
    Return Type Description:
    A format object describing the actual formatting that will be used when displayed this cell in Microsoft Excel.

    Gets the resolved cell formatting for this cell.

    Remarks

    If any cell format properties are the default values on the cell, the values from the owning row's cell format will be used. If those are default, then the values from the owning column's cell format will be used. Otherwise, the workbook default values will be used.

    Note: it is slightly faster to use the WorksheetRow.getResolvedCellFormat method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.GetResolvedCellFormat method.

  • getText

    .getText( );

    Gets the text displayed in the cell.

    Remarks

    The display text is based on the value of the cell and the format string applied to the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellText method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetText method.

  • getText

    .getText( textFormatMode:ig.excel.TextFormatMode );

    Gets the text of the cell.

    • textFormatMode
    • Type:ig.excel.TextFormatMode
    • The format mode to use when getting the cell text.

    Exceptions

    Exception Description
    ig.excel.InvalidEnumArgumentException textFormatMode is not defined in the TextFormatMode enumeration.

    Remarks

    The text is based on the value of the cell and the format string applied to the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellText method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetText method.

  • hasCellFormat

    .hasCellFormat( );

    Gets the value which indicates whether the cell's format has been initialized yet.

  • hasComment

    .hasComment( );
    Return Type:
    boolean
    Return Type Description:
    True if the cell has an associated comment; False otherwise.

    Get the value indicating whether the cell has an associated comment.

    Remarks

    Note: it is slightly faster to use the WorksheetRow.getCellComment method and check for a non null return value, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment method and checking for a non null return value.

  • isCellTypeSupported

    .isCellTypeSupported( cellType:ig.Type );
    Return Type:
    boolean
    Return Type Description:
    True if the type is supported as a cell value, False otherwise.

    Returns True if a particular type of value can be exported to excel.

    • cellType
    • Type:ig.Type
    • The type to test.

    Exceptions

    Exception Description
    ig.ArgumentNullException cellType is null.
  • l_op_Equality

    .l_op_Equality( a:ig.excel.WorksheetCell, b:ig.excel.WorksheetCell );

    • a
    • Type:ig.excel.WorksheetCell
    • b
    • Type:ig.excel.WorksheetCell
  • l_op_Inequality

    .l_op_Inequality( a:ig.excel.WorksheetCell, b:ig.excel.WorksheetCell );

    • a
    • Type:ig.excel.WorksheetCell
    • b
    • Type:ig.excel.WorksheetCell
  • op_Equality

    .op_Equality( a:ig.excel.WorksheetCell, b:ig.excel.WorksheetCell );
    Return Type:
    boolean
    Return Type Description:
    True if the cells refer to the same location on the same worksheet; False otherwise.

    Determines whether two cell instances are equivalent.

    • a
    • Type:ig.excel.WorksheetCell
    • b
    • Type:ig.excel.WorksheetCell
  • op_Inequality

    .op_Inequality( a:ig.excel.WorksheetCell, b:ig.excel.WorksheetCell );
    Return Type:
    boolean
    Return Type Description:
    False if the cells refer to the same location on the same worksheet; True otherwise.

    Determines whether two cell instances are not equivalent.

    • a
    • Type:ig.excel.WorksheetCell
    • b
    • Type:ig.excel.WorksheetCell
  • rowIndex

    .rowIndex( );
    Return Type:
    number
    Return Type Description:
    The row index of the cell.

    Gets the row index of the cell.

  • toString

    .toString( );
    Return Type:
    string
    Return Type Description:
    The string representation of the address of the cell.

    Gets the string representation of the address of the cell.

  • toString

    .toString( cellReferenceMode:ig.excel.CellReferenceMode, includeWorksheetName:boolean );
    Return Type:
    string
    Return Type Description:
    The string representation of the address of the cell.

    Gets the string representation of the address of the cell.

    • cellReferenceMode
    • Type:ig.excel.CellReferenceMode
    • The mode used to generate cell references.
    • includeWorksheetName
    • Type:boolean
    • The value indicating whether to include the worksheet name in the cell address.
  • toString

    .toString( cellReferenceMode:ig.excel.CellReferenceMode, includeWorksheetName:boolean, useRelativeColumn:boolean, useRelativeRow:boolean );
    Return Type:
    string
    Return Type Description:
    The string representation of the address of the cell.

    Gets the string representation of the address of the cell.

    • cellReferenceMode
    • Type:ig.excel.CellReferenceMode
    • The mode used to generate cell references.
    • includeWorksheetName
    • Type:boolean
    • The value indicating whether to include the worksheet name in the cell address.
    • useRelativeColumn
    • Type:boolean
    • The value indicating whether to use a relative column address.
    • useRelativeRow
    • Type:boolean
    • The value indicating whether to use a relative row address.
  • validateValue

    .validateValue( );
    Return Type:
    boolean
    Return Type Description:
    Returns false if the cell has an associated <a href="ig.excel.WorksheetCell.html#methods:dataValidationRule.0">WorksheetCell.dataValidationRule</a> and the current <a href="ig.excel.WorksheetCell.html#methods:value.0">WorksheetCell.value</a> does not pass the validation defined by that rule; otherwise true is returned.

    Returns a boolean indicating if the value of the cell is valid considering the associated WorksheetCell.dataValidationRule

  • value

    .value( );
    Return Type:
    object
    Return Type Description:
    The value of the cell.

    Gets the value of the cell.

    Exceptions

    Exception Description
    ig.NotSupportedException The assigned value's type is not supported and can't be exported to Excel.
    ig.InvalidOperationException The value assigned is a WorksheetCell.formula. Instead, Formula.applyTo should be called on the Formula, passing in the cell.
    ig.InvalidOperationException The value assigned is a WorksheetDataTable. Instead, the WorksheetDataTable.cellsInTable should be set to a region containing the cell.
    ig.InvalidOperationException The value assigned is a FormattedString which is the value another cell or merged cell region.
    ig.InvalidOperationException The value is assigned and this cell is part of an ArrayFormula or WorksheetDataTable.

    Remarks

    If this cell belongs to a merged cell region and it is the top-left cell of the region, getting and setting the value will get and set the value of the associated merged cell region. Getting the value of other cells in a merged cell region will always return null. Setting the value of other cells in a merged cell region will have no effect.

    If a formula has been applied to the cell or a data table is associated with the cell, getting the Value will return the calculated value of the cell.

    The types supported for the value are:

    • System.Byte
    • System.SByte
    • System.Int16
    • System.Int64
    • System.UInt16
    • System.UInt64
    • System.UInt32
    • System.Int32
    • System.Single
    • System.Double
    • System.Boolean
    • System.Char
    • System.Enum
    • System.Decimal
    • System.DateTime
    • System.String
    • System.Text.StringBuilder
    • System.DBNull
    • ErrorValue
    • FormattedString

    Note: it is slightly faster to use the WorksheetRow.getCellValue or WorksheetRow.setCellValue methods, which do not create WorksheetCell instances internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment or WorksheetRow.SetCellComment methods.

  • value

    .value( value:object );
    Return Type:
    object
    Return Type Description:
    The value of the cell.

    Sets the value of the cell.

    • value
    • Type:object

    Exceptions

    Exception Description
    ig.NotSupportedException The assigned value's type is not supported and can't be exported to Excel.
    ig.InvalidOperationException The value assigned is a WorksheetCell.formula. Instead, Formula.applyTo should be called on the Formula, passing in the cell.
    ig.InvalidOperationException The value assigned is a WorksheetDataTable. Instead, the WorksheetDataTable.cellsInTable should be set to a region containing the cell.
    ig.InvalidOperationException The value assigned is a FormattedString which is the value another cell or merged cell region.
    ig.InvalidOperationException The value is assigned and this cell is part of an ArrayFormula or WorksheetDataTable.

    Remarks

    If this cell belongs to a merged cell region and it is the top-left cell of the region, getting and setting the value will get and set the value of the associated merged cell region. Getting the value of other cells in a merged cell region will always return null. Setting the value of other cells in a merged cell region will have no effect.

    If a formula has been applied to the cell or a data table is associated with the cell, getting the Value will return the calculated value of the cell.

    The types supported for the value are:

    • System.Byte
    • System.SByte
    • System.Int16
    • System.Int64
    • System.UInt16
    • System.UInt64
    • System.UInt32
    • System.Int32
    • System.Single
    • System.Double
    • System.Boolean
    • System.Char
    • System.Enum
    • System.Decimal
    • System.DateTime
    • System.String
    • System.Text.StringBuilder
    • System.DBNull
    • ErrorValue
    • FormattedString

    Note: it is slightly faster to use the WorksheetRow.getCellValue or WorksheetRow.setCellValue methods, which do not create WorksheetCell instances internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment or WorksheetRow.SetCellComment methods.

  • worksheet

    .worksheet( );
    Return Type:
    ig.excel.Worksheet
    Return Type Description:
    The worksheet to which the cell belongs.

    Gets the worksheet to which the cell belongs.

Copyright © 1996 - 2024 Infragistics, Inc. All rights reserved.

#