Spread for ASP.NET 11 Product Documentation
NamedStyles Property (SheetView)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : NamedStyles Property
Gets or sets a collection of styles.
Syntax
'Declaration
 
Public Property NamedStyles As NamedStyleCollection
'Usage
 
Dim instance As SheetView
Dim value As NamedStyleCollection
 
instance.NamedStyles = value
 
value = instance.NamedStyles
public NamedStyleCollection NamedStyles {get; set;}

Property Value

NamedStyleCollection object containing collection of styles
Remarks

This property is available at run time only.

By default, the specified collection is shared between all style models in the sheet. When set, all style models that implement the INamedStyleSupport interface in the sheet are updated to reference the new collection.

Example
This example assigns a SheetView object to the active sheet and creates a new NamedStyle object. The BackColor and Border for the NamedStyle are defined, then its added to the NamedStyles collection for the SheetView.
Dim sv As FarPoint.Web.Spread.SheetView
Dim style1 As New FarPoint.Web.Spread.NamedStyle()
style1.BackColor=Color.Yellow
style1.Border=New FarPoint.Web.Spread.Border(BorderStyle.Dotted,Color.Red,3)
sv=FpSpread1.ActiveSheetView
sv.NamedStyles.Add(style1)
sv.DefaultStyle=style1
FarPoint.Web.Spread.SheetView sv=FpSpread1.ActiveSheetView;
FarPoint.Web.Spread.NamedStyle style1=new FarPoint.Web.Spread.NamedStyle();
style1.BackColor=Color.Yellow;
style1.Border=new FarPoint.Web.Spread.Border(BorderStyle.Dotted,Color.Red,3);
sv.NamedStyles.Add(style1);
sv.DefaultStyle=style1;
See Also

Reference

SheetView Class
SheetView Members
NamedStyleCollection Class
NamedStyle Class

User-Task Documentation

Styles for Cells