Spread ASP.NET 6.0 Product Documentation
SetDirectAltRowName Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > INamedStyleSupport Interface : SetDirectAltRowName Method


index
Index of the alternating row style to set; must be between 0 and AltRowCount-1
styleName
Name of the style to set

Glossary Item Box

Sets the specified alternating row style in the model to the specified named style.

Syntax

Visual Basic (Declaration) 
Sub SetDirectAltRowName( _
   ByVal index As Integer, _
   ByVal styleName As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As INamedStyleSupport
Dim index As Integer
Dim styleName As String
 
instance.SetDirectAltRowName(index, styleName)
C# 
void SetDirectAltRowName( 
   int index,
   string styleName
)

Parameters

index
Index of the alternating row style to set; must be between 0 and AltRowCount-1
styleName
Name of the style to set

Example

This example sets the collection of styles used by the style model.
C#Copy Code
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; 
Visual BasicCopy Code
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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.