Spread ASP.NET 14
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / BaseSheetSelectionModel Class / Item Property
Index of the selection
Example


In This Topic
    Item Property (BaseSheetSelectionModel)
    In This Topic
    Gets a selection in the model.
    Syntax
    'Declaration
     
    Public Overridable ReadOnly Default Property Item( _
       ByVal index As Integer _
    ) As CellRange
    'Usage
     
    Dim instance As BaseSheetSelectionModel
    Dim index As Integer
    Dim value As CellRange
     
    value = instance.Item(index)
    public virtual CellRange this[ 
       int index
    ]; {get;}

    Parameters

    index
    Index of the selection

    Property Value

    CellRange object containing the range of the selected cells
    Remarks
    A selection is a selected range of cells.
    Example
    This example returns the number of columns in the selection model.
    FarPoint.Web.Spread.Model.BaseSheetSelectionModel bsm;
    FarPoint.Web.Spread.Model.CellRange cr;
    bsm = (FarPoint.Web.Spread.Model.BaseSheetSelectionModel)FpSpread1.ActiveSheetView.SelectionModel;
    bsm.AddSelection(0, 0, 2, 2);
    cr = bsm[0];
    Response.Write("There are " + cr.ColumnCount + " columns in the selection."); 
    
    Dim bsm As FarPoint.Web.Spread.Model.BaseSheetSelectionModel
    Dim cr As FarPoint.Web.Spread.Model.CellRange
    bsm = FpSpread1.ActiveSheetView.SelectionModel
    bsm.AddSelection(0, 0, 2, 2)
    cr = bsm.Item(0)
    Response.Write("There are " & cr.ColumnCount & " columns in the selection.") 
    See Also