Spread ASP.NET 6.0 Product Documentation
Parse Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > CellRange Class : Parse Method


s
String to be parsed

Glossary Item Box

Converts a string to a cell range.

Syntax

Visual Basic (Declaration) 
Public Shared Function Parse( _
   ByVal s As String _
) As CellRange
Visual Basic (Usage)Copy Code
Dim s As String
Dim value As CellRange
 
value = CellRange.Parse(s)
C# 
public static CellRange Parse( 
   string s
)

Parameters

s
String to be parsed

Exceptions

ExceptionDescription
System.ArgumentNullExceptions is a null reference (Nothing in Visual Basic).
System.FormatExceptions does not represent a cell range.

Remarks

The text passed to the Parse 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 backcolor of the cell.
C#Copy Code
FarPoint.Web.Spread.Model.CellRange range = FarPoint.Web.Spread.Model.CellRange.Parse("B2");
FpSpread1.Sheets[0].Cells[range.Row, range.Column].BackColor = Color.Red;

FpSpread1.Sheets[0].Rows.Count = 6; 			
FarPoint.Web.Spread.Model.CellRange range1 = FarPoint.Web.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;

Visual BasicCopy Code
Dim range As FarPoint.Web.Spread.Model.CellRange
range = FarPoint.Web.Spread.Model.CellRange.Parse("B2")   
FpSpread1.Sheets(0).Cells(range.Row, range.Column).BackColor = Color.Red

            
FpSpread1.Sheets(0).Rows.Count = 6
Dim range1 As FarPoint.Web.Spread.Model.CellRange        
range1 = FarPoint.Web.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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.