Visual Basic (Declaration) | |
---|---|
Public Property DefaultStyle As StyleInfo |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As SheetView Dim value As StyleInfo instance.DefaultStyle = value value = instance.DefaultStyle |
C# | |
---|---|
public StyleInfo DefaultStyle {get; set;} |
Property Value
StyleInfo object containing the style informationIf 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.
- SheetView.DefaultStyle operates on SheetView.DocumentsModels.Style and affects the client area cells in the sheet (all non header cells).
- SheetView.ColumnHeader.DefaultStyle operates on SheetView.DocumentsModels.ColumnHeaderStyle and affects all column header cells in the sheet.
- SheetView.RowHeader.DefaultStyle operates on SheetView.DocumentsModels.RowHeaderStyle and affects all row header cells in the sheet.
- SheetView.SheetCornerStyle gets or sets the style settings for the sheet corner area, which is used by SpreadView to paint the sheet corner.
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.).
C# | Copy Code |
---|---|
fpSpread1.ActiveSheet.DefaultStyle.BackColor = Color.LightBlue; |
Visual Basic | Copy Code |
---|---|
FpSpread1.ActiveSheet.DefaultStyle.BackColor = Color.LightBlue |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
Reference
SheetView ClassSheetView Members