Spread ASP.NET 14
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / CellRange Class / Intersects Method
Row index at beginning of range
Column index at beginning of range
Number of rows
Number of columns
Example


In This Topic
    Intersects Method (CellRange)
    In This Topic
    Determines whether the range of cells intersects the specified range.
    Syntax
    'Declaration
     
    Public Function Intersects( _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal rowCount As Integer, _
       ByVal columnCount As Integer _
    ) As Boolean
    'Usage
     
    Dim instance As CellRange
    Dim row As Integer
    Dim column As Integer
    Dim rowCount As Integer
    Dim columnCount As Integer
    Dim value As Boolean
     
    value = instance.Intersects(row, column, rowCount, columnCount)
    public bool Intersects( 
       int row,
       int column,
       int rowCount,
       int columnCount
    )

    Parameters

    row
    Row index at beginning of range
    column
    Column index at beginning of range
    rowCount
    Number of rows
    columnCount
    Number of columns

    Return Value

    true if the range intersects the other specified range; otherwise false
    Example
    This example creates a CellRange and uses it to set up a selection and a span in the spreadsheet. The several Intersect methods then query whether the selected range intersects the specified column and row and the result is returned to a list box.
    FarPoint.Web.Spread.Model.CellRange range=new FarPoint.Web.Spread.Model.CellRange(0,0,4,4);
    FarPoint.Web.Spread.Model.BaseSheetSelectionModel model;
    model=(FarPoint.Web.Spread.Model.BaseSheetSelectionModel)FpSpread1.ActiveSheetView.SelectionModel;
    FpSpread1.ActiveSheetView.SelectionBackColor=Color.Yellow;
    model.AddSelection(range.Row,range.Column,range.RowCount,range.ColumnCount);
    bool b,b1,b2;
    FpSpread1.ActiveSheetView.ColumnCount=10;
    FpSpread1.ActiveSheetView.RowCount=10;
    FpSpread1.ActiveSheetView.AddSpanCell(range.Row,range.Column,range.RowCount,range.ColumnCount);
    b=range.IntersectColumn(1);
    b1=range.IntersectRow(1);
    b2=range.Intersects(0,0,4,4);
    ListBox1.Items.Add(Convert.ToString(b));
    ListBox1.Items.Add(Convert.ToString(b1));
    ListBox1.Items.Add(Convert.ToString(b2));
    Dim range As New FarPoint.Web.Spread.Model.CellRange(1,1,4,4)
    Dim range1 As New FarPoint.Web.Spread.Model.CellRange(0,0,4,4)
    Dim model As FarPoint.Web.Spread.Model.BaseSheetSelectionModel
    model=FpSpread1.ActiveSheetView.SelectionModel
    FpSpread1.ActiveSheetView.SelectionBackColor=Color.Yellow
    model.AddSelection(range.Row,range.Column,range.RowCount,range.ColumnCount)
    Dim b,b1,b2AsBoolean
    FpSpread1.ActiveSheetView.ColumnCount=10
    FpSpread1.ActiveSheetView.RowCount=10
    FpSpread1.ActiveSheetView.AddSpanCell(range.Row,range.Column,range.RowCount,range.ColumnCount)
    b=range.IntersectColumn(1)
    b1=range.IntersectRow(1)
    b2=range.Intersects(0,0,4,4)
    ListBox1.Items.Add(b)
    ListBox1.Items.Add(b1)
    ListBox1.Items.Add(b2)
    See Also