Search Results for

    Show / Hide Table of Contents

    ExcelFile.SetCellFormat Method

    Overloads

    • ExcelFile.SetCellFormat(Int32, Int32, Int32)
    • ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, Int32)
    • ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat)
    • ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

    ExcelFile.SetCellFormat(Int32, Int32, Int32)

    Sets the Cell format (XF) on a given cell. You can create new formats using the AddFormat function.

    Syntax

    Namespace: FlexCel.Core

    public abstract void SetCellFormat(Int32 row, Int32 col, Int32 XF)

    Parameters

    <-> Parameter Type Description
    row Int32 Row index of the cell (1 based)
    col Int32 Column index of the cell (1 based)
    XF Int32 XF Format index. See 'Cell formats' in the Api Developer Guide.

    See also

    • ExcelFile
    • GetCellFormat(Int32, Int32)
    • AddFormat

    ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, Int32)

    Sets the Cell format (XF) on a range of cells. You can create new formats using the AddFormat function.

    Syntax

    Namespace: FlexCel.Core

    public abstract void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Int32 XF)

    Parameters

    <-> Parameter Type Description
    row1 Int32 Row index of the top cell on the range (1 based)
    col1 Int32 Column index of the left cell on the range (1 based)
    row2 Int32 Row index of the bottom cell on the range (1 based)
    col2 Int32 Column index of the right cell on the range (1 based)
    XF Int32 XF Format index. See 'Cell formats' in the Api Developer Guide.

    See also

    • ExcelFile
    • GetCellFormat(Int32, Int32)
    • AddFormat

    ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat)

    Changes part of the Cell format on a range of cells. WARNING! This method is slower than the other SetCellFormat versions, use it only if you do not care about maximum performance or if you just can't use the other SetCellFormat versions. This particular version of SetCellFormat has to read the format on each cell, modify it and write it back. While still very fast, it is not as fast as just setting the format on a cell.

    Remarks

    You can use this method for example to add a border on the top of a row of cells, keeping the existing font and pattern styles on the range.

    Syntax

    Namespace: FlexCel.Core

    public void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat)

    Parameters

    <-> Parameter Type Description
    row1 Int32 Row index of the top cell on the range (1 based)
    col1 Int32 Column index of the left cell on the range (1 based)
    row2 Int32 Row index of the bottom cell on the range (1 based)
    col2 Int32 Column index of the right cell on the range (1 based)
    newFormat TFlxFormat Format to apply to the cells.
    applyNewFormat TFlxApplyFormat Indicates which properties of newFormat will be applied to the cells.

    See also

    • ExcelFile

    ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

    Changes part of the Cell format on a range of cells. WARNING! This method is slower than the other SetCellFormat versions, use it only if you do not care about maximum performance or if you just can't use the other SetCellFormat versions. This particular version of SetCellFormat has to read the format on each cell, modify it and write it back. While still very fast, it is not as fast as just setting the format on a cell.

    Remarks

    You can use this method for example to add a border on the top of a row of cells, keeping the existing font and pattern styles on the range.

    Syntax

    Namespace: FlexCel.Core

    public abstract void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean exteriorBorders)

    Parameters

    <-> Parameter Type Description
    row1 Int32 Row index of the top cell on the range (1 based)
    col1 Int32 Column index of the left cell on the range (1 based)
    row2 Int32 Row index of the bottom cell on the range (1 based)
    col2 Int32 Column index of the right cell on the range (1 based)
    newFormat TFlxFormat Format to apply to the cells.
    applyNewFormat TFlxApplyFormat Indicates which properties of newFormat will be applied to the cells.
    exteriorBorders Boolean When true, the format for the border will be applied only to the outer cells in the range. This can be useful for example to draw a box around a range of cells, but not drawing borders inside the range.
    Other parameters, like the cell background, will still be applied to the full range.

    See also

    • ExcelFile
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com