Spread Windows Forms 10.0 Product Documentation
Parse Method (CellRange)
Example 


String to be parsed
Converts a string to a cell range.
Syntax
'Declaration
 
Public Shared Function Parse( _
   ByVal s As String _
) As CellRange
'Usage
 
Dim s As String
Dim value As CellRange
 
value = CellRange.Parse(s)
public static CellRange Parse( 
   string s
)

Parameters

s
String to be parsed

Return Value

CellRange object containing the cell range represented by the string
Exceptions
ExceptionDescription
System.ArgumentNullExceptions is a null reference (Nothing in Visual Basic).
System.FormatExceptions does not represent a cell range.
Remarks
The string passed to this method must contain the cell name(s) as a column name (as one or more letters) following by the row number (as one or more digits). The row number is 1-based.
Example
This example sets the background color of the cell and cell range.
FarPoint.Win.Spread.Model.CellRange range = FarPoint.Win.Spread.Model.CellRange.Parse("B2"); 
fpSpread1.Sheets[0].Cells[range.Row, range.Column].BackColor = Color.Red;

FarPoint.Win.Spread.Model.CellRange range1 = FarPoint.Win.Spread.Model.CellRange.Parse("B4:C6");
fpSpread1.Sheets[0].Cells[range1.Row, range1.Column, range1.Row + range1.RowCount - 1, range1.Column + range1.ColumnCount - 1].BackColor = Color.Blue;
Dim range As FarPoint.Win.Spread.Model.CellRange 
range = FarPoint.Win.Spread.Model.CellRange.Parse("B2")
FpSpread1.Sheets(0).Cells(range.Row, range.Column).BackColor = Color.Red

Dim range1 As FarPoint.Win.Spread.Model.CellRange
range1 = FarPoint.Win.Spread.Model.CellRange.Parse("B4:C6")
FpSpread1.Sheets(0).Cells(range1.Row, range1.Column, range1.Row + range1.RowCount - 1, range1.Column + range1.ColumnCount - 1).BackColor = Color.Blue
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

CellRange Class
CellRange Members
TryParse Method

 

 


Copyright © GrapeCity, inc. All rights reserved.