Spread for ASP.NET 12 Product Documentation
Creating a Custom Name
Spread for ASP.NET 12 Product Documentation > Developer's Guide > Managing Formulas > Creating a Custom Name

Custom, user-defined names are identifiers to represent information in the spreadsheet, used mostly in formulas. A custom name can refer to a cell, a range of cells, a computed value, or a formula. You can define a custom name and then use the name in formulas. When the formula is evaluated, the custom name's value is referenced and evaluated.

For more information about formulas, refer to the Formula Reference.

Using Code

Define the custom name using the AddCustomName method.

Example

To add a custom name, use the AddCustomName method as shown in this code:

C#
Copy Code
FarPoint.Web.Spread.Model.DefaultSheetDataModel d = new FarPoint.Web.Spread.Model.DefaultSheetDataModel();
d.AddCustomName("test", "$B$1", 0, 0);
VB
Copy Code
Dim d FarPoint.Web.Spread.Model.DefaultSheetDataModel = New FarPoint.Web.Spread.Model.DefaultSheetDataModel()
d.AddCustomName("test", "$B$1", 0, 0)

Example

To add a custom name for a value, use the AddCustomName method as shown in this code:

C#
Copy Code
FarPoint.Web.Spread.Model.DefaultSheetDataModel d;
d = (FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.Sheets[0].DataModel;
d.AddCustomName("alpha", "101", 0, 0);
VB
Copy Code
Dim d As New FarPoint.Web.Spread.Model.DefaultSheetDataModel
d = (FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.Sheets(0).DataModel
d.AddCustomName("alpha", "101", 0, 0)