Spread Windows Forms 6.0 Product Documentation
GetDirectAltRowInfo Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetStyleModel Class : GetDirectAltRowInfo Method


index
Index of the alternating row style to get
destInfo
StyleInfo object to use for composing the styles

Glossary Item Box

Gets the specified alternating row style in the model.

Syntax

Visual Basic (Declaration) 
Public Overrides Function GetDirectAltRowInfo( _
   ByVal index As Integer, _
   ByVal destInfo As StyleInfo _
) As StyleInfo
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetStyleModel
Dim index As Integer
Dim destInfo As StyleInfo
Dim value As StyleInfo
 
value = instance.GetDirectAltRowInfo(index, destInfo)
C# 
public override StyleInfo GetDirectAltRowInfo( 
   int index,
   StyleInfo destInfo
)

Parameters

index
Index of the alternating row style to get
destInfo
StyleInfo object to use for composing the styles

Return Value

StyleInfo object containing the style settings (format)

Exceptions

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

Remarks

"Direct" in the style model means "not composite" or "not inherited." This method, GetDirectAltRowInfo, returns the alternating style properties that have been set. The alternating row style is used by the viewport controls for merging alternating row styles with the composite style for a cell immediately prior to rendering.

GetDirectInfo returns the style properties that have been set for the specified cell, column, or row directly and does not return any settings that ar set for higher levels (like the entire model), while GetCompositeInfo returns the style properties "composed" or "merged" into one StyleInfo object that contains all the settings to paint and edit the cell, column, or row, including inherited settings.

The index, zero-based, must be between 0 and (AltRowCount-1).

If destInfo is null, then a new StyleInfo object is created and used.

Example

This example illustrates the use of this member by returning the style information for the first alternating row.
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetStyleModel defstyleModel = new FarPoint.Win.Spread.Model.DefaultSheetStyleModel();
FarPoint.Win.Spread.StyleInfo sInfo = new FarPoint.Win.Spread.StyleInfo();
FarPoint.Win.Spread.StyleInfo composite = new FarPoint.Win.Spread.StyleInfo();
defstyleModel = (FarPoint.Win.Spread.Model.DefaultSheetStyleModel)fpSpread1.ActiveSheet.Models.Style;
sInfo.BackColor = Color.LightBlue;
defstyleModel.SetDirectAltRowInfo(0, sInfo);
composite = defstyleModel.GetDirectAltRowInfo(0, sInfo);
listBox1.Items.Add(composite.BackColor.ToString());
Visual BasicCopy Code
Dim defstyleModel As New FarPoint.Win.Spread.Model.DefaultSheetStyleModel()
Dim sInfo As New FarPoint.Win.Spread.StyleInfo()
Dim composite As New FarPoint.Win.Spread.StyleInfo()
defstyleModel = FpSpread1.ActiveSheet.Models.Style
sInfo.BackColor = Color.LightBlue
defstyleModel.SetDirectAltRowInfo(0, sInfo)
composite = defstyleModel.GetDirectAltRowInfo(0, sInfo)
ListBox1.Items.Add(composite.BackColor.ToString())

Requirements

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

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.