Spread for ASP.NET 10 Product Documentation
SetDirectName Method (INamedStyleSupport)
Example 


Row index of the cell in the model, or -1 to specify a column or model default
Column index of the cell in the model, or -1 to specify a row or model default
Name of the style to set
Sets the direct style for the specified cell, column, row, or model default to the specified style name.
Syntax
'Declaration
 
Sub SetDirectName( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal styleName As String _
) 
'Usage
 
Dim instance As INamedStyleSupport
Dim row As Integer
Dim column As Integer
Dim styleName As String
 
instance.SetDirectName(row, column, styleName)
void SetDirectName( 
   int row,
   int column,
   string styleName
)

Parameters

row
Row index of the cell in the model, or -1 to specify a column or model default
column
Column index of the cell in the model, or -1 to specify a row or model default
styleName
Name of the style to set
Example
This example sets the collection of styles used by the style model.
FarPoint.Web.Spread.Model.INamedStyleSupport ins; 
FarPoint.Web.Spread.NamedStyleCollection nsc = new FarPoint.Web.Spread.NamedStyleCollection(); 
FarPoint.Web.Spread.NamedStyle ns1 = new FarPoint.Web.Spread.NamedStyle("StyleHeaders", "HeaderDefault"); 
FarPoint.Web.Spread.NamedStyle ns2 = new FarPoint.Web.Spread.NamedStyle("StyleData", "DataAreaDefault"); 
ns1.BackColor = Color.Yellow; 
ns2.BackColor = Color.LightBlue; 
FpSpread1.NamedStyles.Add(ns1); 
FpSpread1.NamedStyles.Add(ns2); 
ins = (FarPoint.Web.Spread.Model.INamedStyleSupport)FpSpread1.ActiveSheetView.StyleModel; 
ins.SetDirectAltRowName(0, "StyleHeaders"); 
ins.SetDirectName(1, 1, "StyleData"); 
nsc = ins.NamedStyles; 
Dim ins As FarPoint.Web.Spread.Model.INamedStyleSupport
Dim nsc As New FarPoint.Web.Spread.NamedStyleCollection
Dim ns1 As New FarPoint.Web.Spread.NamedStyle("StyleHeaders", "HeaderDefault")
Dim ns2 As New FarPoint.Web.Spread.NamedStyle("StyleData", "DataAreaDefault")
ns1.BackColor = Color.Yellow
ns2.BackColor = Color.LightBlue
FpSpread1.NamedStyles.Add(ns1)
FpSpread1.NamedStyles.Add(ns2)
ins = FpSpread1.ActiveSheetView.StyleModel
ins.SetDirectAltRowName(0, "StyleHeaders")
ins.SetDirectName(1, 1, "StyleData")
nsc = ins.NamedStyles
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

INamedStyleSupport Interface
INamedStyleSupport Members

 

 


Copyright © GrapeCity, inc. All rights reserved.