ComponentOne FlexPivot for WinForms
C1.Win.FlexPivot.4.8 Assembly / C1.Win.FlexPivot Namespace / C1FlexPivotGrid Class / SetCellStyle Method / SetCellStyle(Int32,String,CellStyle) Method
Row index.
Column name.
The C1.Win.C1FlexGrid.CellStyle to associate with the cell.

In This Topic
    SetCellStyle(Int32,String,CellStyle) Method
    In This Topic
    Assigns a custom C1.Win.C1FlexGrid.CellStyle to a cell.
    Syntax
    'Declaration
     
    Public Overloads Sub SetCellStyle( _
       ByVal row As Integer, _
       ByVal colName As String, _
       ByVal newStyle As CellStyle _
    ) 
    public void SetCellStyle( 
       int row,
       string colName,
       CellStyle newStyle
    )

    Parameters

    row
    Row index.
    colName
    Column name.
    newStyle
    The C1.Win.C1FlexGrid.CellStyle to associate with the cell.
    Remarks

    The C1.Win.C1FlexGrid.C1FlexGridBase.SetCellStyle method is useful if you want to assign a new style to a single cell. You can also reset the cell style by setting it to null (Nothing, in VB).

    To apply a custom cell style to an entire row or column, set the row or column's C1.Win.C1FlexGrid.RowCol.Style properties.

    To apply a custom style to a range cells, use a C1.Win.C1FlexGrid.CellRange object. For example:

    CellRange rg = _flex.GetCellRange(3, 3, 10, 10); rg.Style = _flex.Styles["MyRangeStyle"];
    See Also