[]
        
(Showing Draft Content)

C1.Win.FlexGrid.C1FlexGridBase.GetCellRange

GetCellRange Method

GetCellRange(int, int)

Gets a CellRange object that can be used to format and manipulate a cell.

Declaration
public CellRange GetCellRange(int row, int col)
Parameters
Type Name Description
int row

Row index.

int col

Column index.

Returns
Type Description
CellRange

A CellRange object that can be used to format and manipulate the cell.

GetCellRange(int, int, int, int)

Gets a CellRange object that can be used to format and manipulate a range.

Declaration
public CellRange GetCellRange(int topRow, int leftCol, int bottomRow, int rightCol)
Parameters
Type Name Description
int topRow

Top row in the range.

int leftCol

Left column in the range.

int bottomRow

Bottom row in the range.

int rightCol

Right column in the range.

Returns
Type Description
CellRange

A CellRange object that can be used to format and manipulate the range.

Remarks

The CellRange object provides access to properties of the cells in the range. For example, the code below sets the style of a range:

CellRange rg = flex.GetCellRange(5, 5, 20, 8);
rg.Style = flex.Styles["MyStyle"];

Note: CellRange is a class, not a struct. Because of this, you have to assign the value to a variable and then use the variable. For example, the following code will not compile:

// this does not compile
flex.GetCellRange(5, 5, 20, 8).Style = flex.Styles["MyStyle"];