WPF

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridFormulaParsingEventArgs

    Show / Hide Table of Contents

    Class GridFormulaParsingEventArgs

    Used by the event, GridFormulaParsingEventArgs holds a reference to the string that is to be parsed. The GridFormulaParsing event allows the listener to preprocess the string that is being parsed.

    Inheritance
    System.Object
    System.EventArgs
    GridFormulaParsingEventArgs
    Inherited Members
    System.EventArgs.Empty
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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 Description
    System.String
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved