Syncfusion.Grid.Windows
Example 


Syncfusion.Windows.Forms.Grid Namespace > GridModel Class > ChangeCells Method : ChangeCells(GridRangeInfo,GridStyleInfo[],StyleModifyType) Method
A GridRangeInfo that specifies the range of cells.
The array of GridStyleInfo objects that holds cell information.
A Syncfusion.Styles.StyleModifyType that specifies the style operation to be performed.

ChangeCells(GridRangeInfo,GridStyleInfo[],StyleModifyType) Method

Determines whether can applies an array of styles to the specified range of cells.
Syntax
'Declaration
 
Public Overloads Function ChangeCells( _
   ByVal range As GridRangeInfo, _
   ByVal cellsInfo() As GridStyleInfo, _
   ByVal modifyType As StyleModifyType _
) As Boolean
'Usage
 
Dim instance As GridModel
Dim range As GridRangeInfo
Dim cellsInfo() As GridStyleInfo
Dim modifyType As StyleModifyType
Dim value As Boolean
 
value = instance.ChangeCells(range, cellsInfo, modifyType)

Parameters

range
A GridRangeInfo that specifies the range of cells.
cellsInfo
The array of GridStyleInfo objects that holds cell information.
modifyType
A Syncfusion.Styles.StyleModifyType that specifies the style operation to be performed.

Return Value

A System.Boolean that indicates if the operation was successful.
Remarks
ChangeCells(GridRangeInfo,GridStyleInfo[],StyleModifyType) will reset volatile data cache, generate undo information, force recalculation of floating cells, and raise CellsChanging and CellsChanged method.

When you change cells directly with an indexer, this results in a call to ChangeCells(GridRangeInfo,GridStyleInfo[],StyleModifyType) with modifyType set to Syncfusion.Styles.StyleModifyType.Changes.

Example
The following example assigns a previously created style with a bold font to a cell:
GridStyleInfo boldFontStyle = new GridStyleInfo();
boldFontStyle.TextColor =  Color.FromArgb(238, 122, 3);
boldFontStyle.Font = boldFont;
model[rowIndex, 1].Text = "Interior";
model.ChangeCells(GridRangeInfo.Cell(rowIndex, 1), boldFontStyle);
Dim boldFontStyle As New GridStyleInfo()
boldFontStyle.TextColor = Color.FromArgb(238, 122, 3)
boldFontStyle.Font = boldFont
model(rowIndex, 1).Text = "Interior"
model.ChangeCells(GridRangeInfo.Cell(rowIndex, 1), boldFontStyle)
AssemblyVersion

Syncfusion.Grid.Windows: 17.1460.0.47

See Also