Spread Windows Forms 7.0 Product Documentation
AddCustomName(String,Expression,String) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class > AddCustomName Method : AddCustomName(String,Expression,String) Method


name
Name to add
value
Value for name, as expression
comment
Comment for the custom name

Glossary Item Box

Adds a new user-defined name to the model using the specified expression value.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub AddCustomName( _
   ByVal name As String, _
   ByVal value As Expression, _
   ByVal comment As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim name As String
Dim value As Expression
Dim comment As String
 
instance.AddCustomName(name, value, comment)
C# 
public void AddCustomName( 
   string name,
   Expression value,
   string comment
)

Parameters

name
Name to add
value
Value for name, as expression
comment
Comment for the custom name

Example

This example uses the AddCustomName method.
C#Copy Code
FarPoint.Win.Spread.Model.ISheetDataModel model1 = fpSpread1.Sheets[0].Models.Data;
FarPoint.Win.Spread.Model.DefaultSheetDataModel modelCustomNameSupport = model1 as FarPoint.Win.Spread.Model.DefaultSheetDataModel;
FarPoint.CalcEngine.Expression exp1 = new FarPoint.CalcEngine.CellExpression(0, 0);
modelCustomNameSupport.AddModelScopeCustomName("Test_1", exp1, "comment of sheet scope custom name"); //Custom name for sheetview
modelCustomNameSupport.AddCustomName("Test_2", exp1, "comment of workbook scope custom name");//Custom name for workbook
string comment = modelCustomNameSupport.GetModelScopeCustomNameComment("Test_1");
string comment1 = modelCustomNameSupport.GetCustomNameComment("Test_2");
listBox1.Items.Add(comment);
listBox1.Items.Add(comment1);
VB.NETCopy Code
Dim model1 As FarPoint.Win.Spread.Model.ISheetDataModel = FpSpread1.Sheets(0).Models.Data
Dim modelCustomNameSupport As FarPoint.Win.Spread.Model.DefaultSheetDataModel = TryCast(model1, FarPoint.Win.Spread.Model.DefaultSheetDataModel)
Dim exp1 As FarPoint.CalcEngine.Expression = New FarPoint.CalcEngine.CellExpression(0, 0)
'Custom name for sheetview
modelCustomNameSupport.AddModelScopeCustomName("Test_1", exp1, "comment of sheet scope custom name")
'Custom name for workbook
modelCustomNameSupport.AddCustomName("Test_2", exp1, "comment of workbook scope custom name")
Dim comment As String = modelCustomNameSupport.GetModelScopeCustomNameComment("Test_1")
Dim comment1 As String = modelCustomNameSupport.GetCustomNameComment("Test_2")
ListBox1.Items.Add(comment)
ListBox1.Items.Add(comment1)

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.