[]
        
(Showing Draft Content)

C1.Win.C1FlexGrid.C1FlexGridBase.SetCellStyle

SetCellStyle Method

SetCellStyle(int, string, CellStyle)

Assigns a custom CellStyle to a cell.

Declaration
public void SetCellStyle(int row, string colName, CellStyle newStyle)
Parameters
Type Name Description
int row

Row index.

string colName

Column name.

CellStyle newStyle

The CellStyle to associate with the cell.

Remarks

The SetCellStyle(int, string, CellStyle) 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 Style properties.

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

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

SetCellStyle(int, int, CellStyle)

Assigns a custom CellStyle to a cell.

Declaration
public void SetCellStyle(int row, int col, CellStyle newStyle)
Parameters
Type Name Description
int row

Row index.

int col

Column index

CellStyle newStyle

The CellStyle to associate with the cell.

Remarks

The SetCellStyle(int, string, CellStyle) 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 Style properties.

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

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

SetCellStyle(int, int, string)

Assigns a custom CellStyle to a cell.

Declaration
public void SetCellStyle(int row, int col, string styleName)
Parameters
Type Name Description
int row

Row index.

int col

Column index

string styleName

Name of the new style.