Spread ASP.NET 6.0 Product Documentation
GetCompositeInfo Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetStyleModel Class : GetCompositeInfo 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
altIndex
Alternating row index of the cell, or -1 to skip composing any alternating style
destInfo
Specifies a StyleInfo object to use for composing the styles

Glossary Item Box

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

Syntax

Visual Basic (Declaration) 
Public Overrides Function GetCompositeInfo( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal altIndex 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 altIndex As Integer
Dim destInfo As StyleInfo
Dim value As StyleInfo
 
value = instance.GetCompositeInfo(row, column, altIndex, destInfo)
C# 
public override StyleInfo GetCompositeInfo( 
   int row,
   int column,
   int altIndex,
   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
altIndex
Alternating row index of the cell, or -1 to skip composing any alternating style
destInfo
Specifies a StyleInfo object to use for composing the styles

Return Value

StyleInfo object containing the style settings

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
System.IndexOutOfRangeException Specified index is not valid; must be between 0 and the total number of styles

Remarks

Spread uses a composite of style settings to paint the spreadsheet. For example, for a cell, the component looks at the style settings for the column and row for the cell, and the cell's own settings.

To get or set direct setting information, use the GetDirectInfo and SetDirectInfo methods.

Do not use this method to return the style information for alternating rows. Alternating rows styles are handled directly. Use the GetDirectAltRowInfo method.

Example

This example sets the background color of the cell A1 to yellow and sets the foreground color of the first row to red. The composited style of the cell A1 then has yellow background color and red foreground color.
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.StyleInfostyle=newFarPoint.Web.Spread.StyleInfo();
style.BackColor=Color.Yellow;
model.SetDirectInfo(0,0,style);

FarPoint.Web.Spread.StyleInfostyle1=newFarPoint.Web.Spread.StyleInfo();
style1.ForeColor=Color.Red;
model.SetDirectInfo(0,-1,style1);

FpSpread1.Sheets[0].SetValue(0,0,"Style");

style=model.GetCompositeInfo(0,0,-1,null);
ListBox1.Items.Add("BackColor"+style.BackColor.ToString());
ListBox1.Items.Add("ForeColor"+style.ForeColor.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.StyleInfo()
style.BackColor=Color.Yellow
model.SetDirectInfo(0,0,style)

Dimstyle1AsNewFarPoint.Web.Spread.StyleInfo()
style1.ForeColor=Color.Red
model.SetDirectInfo(0,-1,style1)

FpSpread1.Sheets(0).SetValue(0,0,"Style")

style=model.GetCompositeInfo(0,0,-1,Nothing)
ListBox1.Items.Add("BackColor"&style.BackColor.ToString())
ListBox1.Items.Add("ForeColor"&style.ForeColor.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.