Spread Windows Forms 12.0 Product Documentation
SetDirectInfo Method (DefaultSheetStyleModel)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetStyleModel Class : SetDirectInfo Method
Model row index of the cell, or -1 to specify a column or model default
Model column index of the cell, or -1 to specify a row or model default
Style object set (StyleInfo or NamedStyle)
Sets the direct style for the specified cell, column, row, or model default.
Syntax
'Declaration
 
Public Overrides Sub SetDirectInfo( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal info As StyleInfo _
) 
'Usage
 
Dim instance As DefaultSheetStyleModel
Dim row As Integer
Dim column As Integer
Dim info As StyleInfo
 
instance.SetDirectInfo(row, column, info)
public override void SetDirectInfo( 
   int row,
   int column,
   StyleInfo info
)

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
info
Style object set (StyleInfo or NamedStyle)
Exceptions
ExceptionDescription
Specified row index is not valid; must be between -1 and the total number of rows
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, 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 information for the specified cell.
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());
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())
See Also

Reference

DefaultSheetStyleModel Class
DefaultSheetStyleModel Members