Spread Windows Forms 6.0 Product Documentation
IsValidRange(SheetView) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > CellRange Class > IsValidRange Method : IsValidRange(SheetView) Method


sheetView
SheetView object with the sheet

Glossary Item Box

Determines whether this cell range is valid in the specified sheet.

Syntax

Visual Basic (Declaration) 
Public Overloads Function IsValidRange( _
   ByVal sheetView As SheetView _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As CellRange
Dim sheetView As SheetView
Dim value As Boolean
 
value = instance.IsValidRange(sheetView)
C# 
public bool IsValidRange( 
   SheetView sheetView
)

Parameters

sheetView
SheetView object with the sheet

Return Value

Boolean: true if range is valid; false otherwise

Example

This example colors the cells if the range is valid.
C#Copy Code
FarPoint.Win.Spread.Model.CellRange cr = new FarPoint.Win.Spread.Model.CellRange(0, 0, 3, 3); 
fpSpread1.ActiveSheet.Models.Span.Add(cr.Row, cr.Column, cr.RowCount, cr.ColumnCount); 
bool b = cr.IsValidRange(fpSpread1.ActiveSheet); 
if (b) { 
     fpSpread1.ActiveSheet.Cells(cr.Row, cr.Column, cr.RowCount - 1, cr.ColumnCount - 1).BackColor = Color.Red; 
}
Visual BasicCopy Code
Dim cr As New FarPoint.Win.Spread.Model.CellRange(0, 0, 3, 3)
FpSpread1.ActiveSheet.Models.Span.Add(cr.Row, cr.Column, cr.RowCount, cr.ColumnCount)
Dim b As Boolean = cr.IsValidRange(FpSpread1.ActiveSheet)
If b Then
     FpSpread1.ActiveSheet.Cells(cr.Row, cr.Column, cr.RowCount - 1, cr.ColumnCount - 1).BackColor = Color.Red
End If

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.