public static void SetAndGetValueOfCellA1() { #region radspreadsheet-features-formulas_0 Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.ActiveWorksheet.Cells[0, 0].SetValue("=3+4"); #endregion #region radspreadsheet-features-formulas_1 FormulaCellValue formulaCellValue = workbook.ActiveWorksheet.Cells[0, 0].GetValue().Value as FormulaCellValue; if (formulaCellValue != null) { RadExpression expression = formulaCellValue.Value; //expression is AdditionExpression with operands 3 and 4 CellValueFormat format = workbook.ActiveWorksheet.Cells[0, 0].GetFormat().Value; string valueAsString = formulaCellValue.GetValueAsString(format); //valueAsString = "=3+4" string resultValueAsString = formulaCellValue.GetResultValueAsString(format); //resultAsString = "7" CellValueType valueType = formulaCellValue.ValueType; //valueType = Formula CellValueType resultValueType = formulaCellValue.ResultValueType; //resultValueType = Number } #endregion }
protected override RadExpression EvaluateOverride(RadExpression[] arguments) { return NumberExpression.E; }
protected override RadExpression EvaluateOverride(RadExpression[] arguments) { return new NumberExpression(arguments.Length); }