Spread ASP.NET 6.0 Product Documentation
GetDirectAltRowName Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetStyleModel Class : GetDirectAltRowName Method


index
Index of the alternating row style to set

Glossary Item Box

Gets the style name for an alternating row style.

Syntax

Visual Basic (Declaration) 
Public Overridable Function GetDirectAltRowName( _
   ByVal index As Integer _
) As String
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetStyleModel
Dim index As Integer
Dim value As String
 
value = instance.GetDirectAltRowName(index)
C# 
public virtual string GetDirectAltRowName( 
   int index
)

Parameters

index
Index of the alternating row style to set

Return Value

String containing the name of the style of the specified alternating row, or an emtpy string if the specified alternating row index has no named style assigned

Exceptions

ExceptionDescription
System.IndexOutOfRangeException Specified index is not valid; must be between 0 and the total number of styles

Remarks

The index must be between 0 and the value of the AltRowCount property minus 1

Example

This example creates a new NamedStyle object. The name and the background color properties of the NamedStyle are set, and the name of the NamedStyle is retrieved using this method.
C#Copy Code
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;

FarPoint.Web.Spread.Model.DefaultSheetStyleModelmodel=(FarPoint.Web.Spread.Model.DefaultSheetStyleModel)FpSpread1.Sheets[0].StyleModel;
FarPoint.Web.Spread.NamedStylestyle=newFarPoint.Web.Spread.NamedStyle();
style.Name="YellowCell";
style.BackColor=Color.Yellow;

model.SetDirectAltRowInfo(0,style);
ListBox1.Items.Add("StyleName:"+model.GetDirectAltRowName(0));

FarPoint.Web.Spread.StyleInfostyle1=model.GetDirectAltRowInfo(0,null);
ListBox1.Items.Add("BackColor:"+style1.BackColor.ToString());
}
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
If(IsPostBack)ThenReturn

DimmodelAsFarPoint.Web.Spread.Model.DefaultSheetStyleModel=FpSpread1.Sheets(0).StyleModel
DimstyleAsNewFarPoint.Web.Spread.NamedStyle()
style.Name="YellowCell"
style.BackColor=Color.Yellow

model.SetDirectAltRowInfo(0,style)
ListBox1.Items.Add("StyleName:"&model.GetDirectAltRowName(0))

Dimstyle1AsFarPoint.Web.Spread.StyleInfo=model.GetDirectAltRowInfo(0,NoThing)
ListBox1.Items.Add("BackColor:"&style1.BackColor.ToString())
EndSub

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.