Spread Windows Forms 12.0 Product Documentation
SelectionPolicy Property (SheetView)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : SelectionPolicy Property
Gets the selection policy for the sheet for normal operation mode.
Syntax
'Declaration
 
Public Property SelectionPolicy As SelectionPolicy
'Usage
 
Dim instance As SheetView
Dim value As SelectionPolicy
 
instance.SelectionPolicy = value
 
value = instance.SelectionPolicy
public SelectionPolicy SelectionPolicy {get; set;}

Property Value

SelectionPolicy setting that determines the display of selections
Remarks

Use this property if the OperationMode property is set to OperationMode.Normal to customize the sheet so that users can select single cells, a range of cells, or multiple ranges of cells. This property does not have an effect if the OperationMode property is set to a value other than OperationMode.Normal.

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

User-Task Documentation

Specifying What the User Can Select
Customizing User Selection of Data