Class FormulaParsingEventArgs
Used by the FormulaParsing event, FormulaParsingEventArgs holds a reference to the string that is to be parsed. The FormulaParsing event allows the listener to preprocess the string that is being parsed.
Inheritance
System.Object
FormulaParsingEventArgs
Namespace: Syncfusion.Calculate
Assembly: Syncfusion.XlsIO.UWP.dll
Syntax
public class FormulaParsingEventArgs : EventArgs
Remarks
Please note that this event may be raised more than once as a string is parsed.
Examples
Here is code snippets that show how to tell a engine to also treat any text in a formula cell that begins with a minus(-) or a plus(+) as formulas. The default behavior is to treat only text beginning with equal(=) as formulas.
//subscribe to the event before any formulas are loaded into the grid...
Engine.FormulaParsing += new FormulaParsingEventHandler(Engine_FormulaParsing);
//Here is the handler code that adds an = if necessary so any string beginning with +, - or =
//is treated as a formula.
void Engine_FormulaParsing(object sender, FormulaParsingEventArgs e)
{
//allow cells starting with + and - to be treated as formula cells.
if (e.Text.StartsWith("-"))
e.Text = "=" + e.Text;
else if (e.Text.StartsWith("+"))
e.Text = "=" + e.Text.Substring(1);
}
Constructors
FormulaParsingEventArgs()
Default constructor.
Declaration
public FormulaParsingEventArgs()
FormulaParsingEventArgs(String)
Holds a reference to the string that is to be parsed..
Declaration
public FormulaParsingEventArgs(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The formula that is to be parsed. |
Properties
Text
A property that gets/sets the formula about to be parsed.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |