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


row
Model row index of the cell, or -1 to specify a column or model default
column
Model column index of the cell, or -1 to specify a row or model default
destInfo
StyleInfo object to use for getting the style

Glossary Item Box

Gets the direct style for the specified cell, column, row, or model default.

Syntax

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

Parameters

row
Model row index of the cell, or -1 to specify a column or model default
column
Model column index of the cell, or -1 to specify a row or model default
destInfo
StyleInfo object to use for getting the style

Return Value

StyleInfo object containing the style settings (format)

Exceptions

ExceptionDescription
System.IndexOutOfRangeException Specified row index is not valid; must be between -1 and the total number of rows
System.IndexOutOfRangeException Specified column index is not valid; must be between -1 and the total number of columns

Remarks

"Direct" in the style model means "not composite" or "not inherited." This method, 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.

Alternating row styles are not included in this method. GetDirectAltRowInfo returns the alternating row style information.

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

In terms of precedence of styles, direct cell styles override direct row styles, which override direct column styles, which override model default styles.

In terms of allowed values, for a direct row style, use -1 for the entire column; for a direct column style, use -1 for the entire row; and for a model default style, use -1 for all the rows and columns.

Example

This example sets and returns the information for the specified cell.
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 direct = new FarPoint.Win.Spread.StyleInfo();
defstyleModel = (FarPoint.Win.Spread.Model.DefaultSheetStyleModel)fpSpread1.ActiveSheet.Models.Style;
sInfo.BackColor = Color.LightBlue;
defstyleModel.SetDirectInfo(0, 0, sInfo);
direct = defstyleModel.GetDirectInfo(0, 0, sInfo);
listBox1.Items.Add(direct.BackColor.ToString());
Visual BasicCopy Code
Dim defstyleModel As New FarPoint.Win.Spread.Model.DefaultSheetStyleModel()
Dim sInfo As New FarPoint.Win.Spread.StyleInfo()
Dim direct As New FarPoint.Win.Spread.StyleInfo()
defstyleModel = FpSpread1.ActiveSheet.Models.Style
sInfo.BackColor = Color.LightBlue
defstyleModel.SetDirectInfo(0, 0, sInfo)
direct = defstyleModel.GetDirectInfo(0, 0, sInfo)
ListBox1.Items.Add(direct.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.