Spread Windows Forms 9.0 Product Documentation
DefaultStyle Property (SheetView)
Example 


Gets or sets a StyleInfo object for the default style of the sheet.
Syntax
'Declaration
 
Public Property DefaultStyle As StyleInfo
'Usage
 
Dim instance As SheetView
Dim value As StyleInfo
 
instance.DefaultStyle = value
 
value = instance.DefaultStyle
public StyleInfo DefaultStyle {get; set;}

Property Value

StyleInfo object containing the style information
Remarks

If you are assigning the same color (for example) to every cell, it is best to set the color to the DefaultStyle of the SheetView object. If you are assigning different colors (for example) to every cell, set the styles directly in the StyleModel of the SheetView.

DefaultStyle and its related properties are wrapper object properties which get or set the style model's StyleInfo object (style property settings) for row -1 and column -1, which is inherited by all cells in the style model's GetCompositeInfo method unless overridden by another StyleInfo object setting at the column, row, or cell level.

All of those properties have corresponding Name properties for getting and setting style names for NamedStyle objects in SheetView.NamedStyles (that is, SheetView.DefaultStyleName, SheetView.SheetCornerStyleName, etc.).

Example
This example sets the background color and text color for the sheet based on the style information provided.
fpSpread1.ActiveSheet.DefaultStyle.BackColor = Color.LightBlue;
FpSpread1.ActiveSheet.DefaultStyle.BackColor = Color.LightBlue
Requirements

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

See Also

Reference

SheetView Class
SheetView Members

User-Task Documentation

Creating and Applying a Style for Cells

 

 


Copyright © GrapeCity, inc. All rights reserved.