Spread for ASP.NET 11 Product Documentation
Customizing the Appearance of Selections
Spread for ASP.NET 11 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.

Using the Properties Window

  1. At design time, in the Properties window, select the FpSpread component.
  2. Select the Sheets property.
  3. Click the button to display the SheetView Collection Editor.
  4. Set the various selection properties.
  5. Click OK to close the editor.

Using a Shortcut

  1. Set the SelectionBackColorStyle property.
  2. Set the SelectionBackColor property.
  3. Set the SelectionPolicy property.

Example

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 

Using the Spread Designer

  1. Select the Settings menu.
  2. Select the Colors icon from the Sheet Settings section.
  3. Set the various selection options. Click OK to close the dialog.
  4. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.
See Also