Class GridFormulaParsingEventArgs
Used by the
Inheritance
System.Object
GridFormulaParsingEventArgs
Namespace: Syncfusion.Windows.Controls.Grid
Assembly: Syncfusion.Grid.Wpf.dll
Syntax
public class GridFormulaParsingEventArgs : EventArgs
Remarks
Please note that this event may be raised more than once as a string is parsed.
Examples
Here is a code snippet that shows how to tell a grid 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...
var engine = ((GridCellFormulaModel)gridControl.Model.CellModels["FormulaCell"]).Engine;
engine.FormulaParsing += Engine_FormulaParsing;
//Here is the handler code that adds an = if necessary so any string beginning with +, - or =
//is treated as a formula.
private void Engine_FormulaParsing(object sender, GridFormulaParsingEventArgs 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
GridFormulaParsingEventArgs()
Default constructor.
Declaration
public GridFormulaParsingEventArgs()
GridFormulaParsingEventArgs(String)
Holds a reference to the string that is to be parsed..
Declaration
public GridFormulaParsingEventArgs(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The formula that is to be parsed. |
Properties
Text
Get or sets the formula about to be parsed.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |