Spread for ASP.NET 9.0 Product Documentation > Developer's Guide > Customizing User Interaction > Customizing Selections of Cells > Customizing the Appearance of Selections |
Selections have a default appearance provided by the component and the selection renderer. You can change that appearance, including the background and text colors as well as the border. By default, when you click on a row header, the entire row is selected and when you click on a column header, the entire column is selected. The active cell retains a different appearance to show you which cell is active. You can change the selection behavior by setting the OperationMode for the sheet.
Set the SheetView object’s SelectionBackColor and SelectionForeColor to specify the colors to use for the background and for the text (SelectionForeColor only applies to downlevel browsers). Set the SheetView object’s SelectionBorder to specify the border for selections (downlevel browser only). Assign the SheetView object you have created to one of the sheets in the component.
You can also change the appearance by setting the selection colors in a custom skin and applying that skin to the sheet. For more information about skins, refer to Creating a Skin for Sheets and Applying a Skin to a Sheet.
This example code sets the selection backcolor and policies.
C# |
Copy Code
|
---|---|
FpSpread1.Sheets[0].SelectionBackColorStyle = FarPoint.Web.Spread.SelectionBackColorStyles.SelectionBackColor; FpSpread1.Sheets[0].SelectionBackColor = Color.SaddleBrown; FpSpread1.Sheets[0].SelectionPolicy = FarPoint.Web.Spread.Model.SelectionPolicy.MultiRange; |
VB |
Copy Code
|
---|---|
FpSpread1.Sheets(0).SelectionBackColorStyle = FarPoint.Web.Spread.SelectionBackColorStyles.SelectionBackColor FpSpread1.Sheets(0).SelectionBackColor = Color.SaddleBrown FpSpread1.Sheets(0).SelectionPolicy = FarPoint.Web.Spread.Model.SelectionPolicy.MultiRange |