Spread Windows Forms 7.0 Product Documentation
GetSelections Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > IDisjointSelections Interface : GetSelections Method


rowCount
Number of rows in the sheet
columnCount
Number of columns in the sheet

Glossary Item Box

Gets an ordered array of cell ranges, from largest to smallest, containing the selected cells with minimal overlap between the ranges.

Syntax

Visual Basic (Declaration) 
Function GetSelections( _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As CellRange()
Visual Basic (Usage)Copy Code
Dim instance As IDisjointSelections
Dim rowCount As Integer
Dim columnCount As Integer
Dim value() As CellRange
 
value = instance.GetSelections(rowCount, columnCount)
C# 
CellRange[] GetSelections( 
   int rowCount,
   int columnCount
)

Parameters

rowCount
Number of rows in the sheet
columnCount
Number of columns in the sheet

Return Value

Ordered array of CellRange objects, from largest to smallest, containing the selected cells

Example

This example returns the starting row of the first selection and the starting column of the second selection.
C#Copy Code
FarPoint.Win.Spread.Model.IDisjointSelections djs;
FarPoint.Win.Spread.Model.CellRange[] cr;
djs = (FarPoint.Win.Spread.Model.IDisjointSelections)fpSpread1.ActiveSheet.Models.Selection;
fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2);
fpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2);
cr = djs.GetSelections(4, 4);
label1.Text = "The first row in the first selection is " + cr[0].Row + " and the " +
"first column of the second selection is " + cr[1].Column;
Visual BasicCopy Code
Dim djs As FarPoint.Win.Spread.Model.IDisjointSelections
Dim cr As FarPoint.Win.Spread.Model.CellRange()
djs = FpSpread1.ActiveSheet.Models.Selection
FpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2)
FpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2)
cr = djs.GetSelections(4, 4)
Label1.Text = "The first row in the first selection is " & cr(0).Row & " and the " & _
"first column of the second selection is " & cr(1).Column

Requirements

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

See Also

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