Spread Windows Forms 11.0 Product Documentation
SelectionUnit Property (SheetView)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : SelectionUnit Property
Gets or sets the smallest unit users or the application can select on this sheet.
Syntax
'Declaration
 
Public Property SelectionUnit As SelectionUnit
'Usage
 
Dim instance As SheetView
Dim value As SelectionUnit
 
instance.SelectionUnit = value
 
value = instance.SelectionUnit
public SelectionUnit SelectionUnit {get; set;}

Property Value

SelectionUnit setting that determines the unit of selections
Remarks

Use this property if the OperationMode property is set to OperationMode.Normal or OperationMode.ReadOnly to customize the sheet so that users and the application can only select certain items.

If you want to specify that users can only select certain items, but not restrict the application from selecting certain items and the OperationMode property is set to OperationMode.Normal or OperationMode.ReadOnly, set the FpSpread class's or SpreadView class's SelectionBlockOptions property.

Example
This example specifies the selection policy for the sheet for normal operation mode, and sets the background color and text color for selections.
fpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors;
fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range;
fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell;
fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2);
fpSpread1.ActiveSheet.AddSelection(3, 0, 2, 2);
fpSpread1.ActiveSheet.SelectionBackColor = Color.Red;
fpSpread1.ActiveSheet.SelectionForeColor = Color.DarkBlue;
FpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors
FpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range
FpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell
FpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2)
FpSpread1.ActiveSheet.AddSelection(3, 0, 2, 2)
FpSpread1.ActiveSheet.SelectionBackColor = Color.Red
FpSpread1.ActiveSheet.SelectionForeColor = Color.DarkBlue
See Also

Reference

SheetView Class
SheetView Members
OperationMode Property
SelectionBlockOptions Property

User-Task Documentation

Specifying What the User Can Select
Customizing User Selection of Data