Spread for ASP.NET 8.0 Product Documentation
GetCompositeInfo Method (DefaultSheetStyleModel)
Example 


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
Alternating row index of the cell, or -1 to skip composing any alternating style
Specifies a StyleInfo object to use for composing the styles
Gets the composite style for the specified cell, column, row, or model default.
Syntax
'Declaration
 
Public Overrides Function GetCompositeInfo( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal altIndex As Integer, _
   ByVal destInfo As StyleInfo _
) As StyleInfo
'Usage
 
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)
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.
private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;

FarPoint.Web.Spread.Model.DefaultSheetStyleModel model=(FarPoint.Web.Spread.Model.DefaultSheetStyleModel)FpSpread1.Sheets[0].StyleModel;
FarPoint.Web.Spread.StyleInfo style=new FarPoint.Web.Spread.StyleInfo();
style.BackColor=Color.Yellow;
model.SetDirectInfo(0,0,style);

FarPoint.Web.Spread.StyleInfo style1=new FarPoint.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());
}
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
If(IsPostBack)Then Return

Dim model As FarPoint.Web.Spread.Model.DefaultSheetStyleModel=FpSpread1.Sheets(0).StyleModel
Dim style As New FarPoint.Web.Spread.StyleInfo()
style.BackColor=Color.Yellow
model.SetDirectInfo(0,0,style)

Dim style1 As New FarPoint.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())
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

DefaultSheetStyleModel Class
DefaultSheetStyleModel Members
GetDirectInfo Method
GetDirectAltRowInfo Method
SetDirectInfo Method

 

 


Copyright © GrapeCity, inc. All rights reserved.