Spread Silverlight Documentation
SetCustomName(String,Int32,Int32,String) Method
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class > SetCustomName Method : SetCustomName(String,Int32,Int32,String) Method
The custom name.
The base row.
The base column.
The formula to set.
Sets a custom name using the specified formula.
Syntax
'Declaration
 
Public Overloads Sub SetCustomName( _
   ByVal name As System.String, _
   ByVal baseRow As System.Integer, _
   ByVal baseColumn As System.Integer, _
   ByVal formula As System.String _
) 
'Usage
 
Dim instance As Worksheet
Dim name As System.String
Dim baseRow As System.Integer
Dim baseColumn As System.Integer
Dim formula As System.String
 
instance.SetCustomName(name, baseRow, baseColumn, formula)
public void SetCustomName( 
   System.string name,
   System.int baseRow,
   System.int baseColumn,
   System.string formula
)

Parameters

name
The custom name.
baseRow
The base row.
baseColumn
The base column.
formula
The formula to set.
Remarks
For example, SetCustomName("GAMMA",2,2,"A6*A7") means to use formula "A6*A7" at 2,2 and call it "GAMMA". When using SetFormula(7,7,"GAMMA"), the offset is (7-2),(7-2), move A6,A7 by (5,5) then set value to A11 A12. The result is A11*A12.
Example
This example uses the SetCustomName method.
gcSpreadSheet1.Sheets[0].SetValue(0, 0, 1);
gcSpreadSheet1.Sheets[0].SetValue(0, 1, 2);
gcSpreadSheet1.Sheets[0].SetValue(0, 2, 3);
gcSpreadSheet1.Sheets[0].SetCustomName("customName1", 0, 0, new CalcDoubleExpression(12));
gcSpreadSheet1.Sheets[0].SetCustomName("customName2", 0, 0, "Average(20,45)");
gcSpreadSheet1.Sheets[0].SetCustomName("customName3", 0, 0, 1, 3);
gcSpreadSheet1.Sheets[0].SetFormula(1, 0, "customName1");
gcSpreadSheet1.Sheets[0].SetFormula(1, 1, "customName2");
gcSpreadSheet1.Sheets[0].SetFormula(1, 2, "sum(customName3)");
GcSpreadSheet1.Sheets(0).SetValue(0, 0, 1)
GcSpreadSheet1.Sheets(0).SetValue(0, 1, 2)
GcSpreadSheet1.Sheets(0).SetValue(0, 2, 3)
GcSpreadSheet1.Sheets(0).SetCustomName("customName1", 0, 0, New CalcDoubleExpression(12))
GcSpreadSheet1.Sheets(0).SetCustomName("customName2", 0, 0, "Average(20,45)")
GcSpreadSheet1.Sheets(0).SetCustomName("customName3", 0, 0, 1, 3)
GcSpreadSheet1.Sheets(0).SetFormula(1, 0, "customName1")
GcSpreadSheet1.Sheets(0).SetFormula(1, 1, "customName2")
GcSpreadSheet1.Sheets(0).SetFormula(1, 2, "sum(customName3)")
See Also

Reference

Worksheet Class
Worksheet Members
Overload List