Spread Windows Forms 6.0 Product Documentation
SetDirectInfo Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > ISheetStyleModel Interface : SetDirectInfo Method


row
Row index of the cell in the model, or -1 to specify an entire column or the model default
column
Column index of the cell in the model, or -1 to specify an entire row or the model default
info
Style set (StyleInfo object)

Glossary Item Box

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

Syntax

Visual Basic (Declaration) 
Sub SetDirectInfo( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal info As StyleInfo _
) 
Visual Basic (Usage)Copy Code
Dim instance As ISheetStyleModel
Dim row As Integer
Dim column As Integer
Dim info As StyleInfo
 
instance.SetDirectInfo(row, column, info)
C# 
void SetDirectInfo( 
   int row,
   int column,
   StyleInfo info
)

Parameters

row
Row index of the cell in the model, or -1 to specify an entire column or the model default
column
Column index of the cell in the model, or -1 to specify an entire row or the model default
info
Style set (StyleInfo object)

Remarks

"Direct" in the style model means "not composite" or "not inherited." This method, SetDirectInfo, sets the style properties for the specified cell, column, or row directly. SetDirectAltRowInfo sets the alternating row style information.

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 direct style for the specified cell, column, row, or model default.
C#Copy Code
FarPoint.Win.Spread.Model.ISheetStyleModel ssm;
FarPoint.Win.Spread.NamedStyle ns = new FarPoint.Win.Spread.NamedStyle("StyleData");
FarPoint.Win.Spread.StyleInfo si;
ssm = (FarPoint.Win.Spread.Model.ISheetStyleModel)fpSpread1.ActiveSheet.Models.Style;
ns.BackColor = Color.Yellow;
fpSpread1.NamedStyles.Add(ns);
ssm.SetDirectInfo(0, 0, ns);
si = ssm.GetDirectInfo(0, 0, null);
label1.Text = "The background color of the first cell is " + si.BackColor.ToString();
Visual BasicCopy Code
Dim ssm As FarPoint.Win.Spread.Model.ISheetStyleModel
Dim ns As New FarPoint.Win.Spread.NamedStyle("StyleData")
Dim si As FarPoint.Win.Spread.StyleInfo
ssm = FpSpread1.ActiveSheet.Models.Style
ns.BackColor = Color.Yellow
FpSpread1.NamedStyles.Add(ns)
ssm.SetDirectInfo(0, 0, ns)
si = ssm.GetDirectInfo(0, 0, Nothing)
Label1.Text = "The background color of the first cell is " & si.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.