WinForms

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

    Show / Hide Table of Contents

    Class GridFormulaCellRenderer

    Implements a GridCellRender that supports formulas.

    Inheritance
    System.Object
    NonFinalizeDisposable
    GridCellRendererBase
    GridStaticCellRenderer
    GridTextBoxCellRenderer
    GridFormulaCellRenderer
    Implements
    IQueryFocusInside
    IGridDropDownCell
    IPopupParent
    IPopupItem
    System.IDisposable
    Inherited Members
    GridTextBoxCellRenderer.GetEditState()
    GridTextBoxCellRenderer.SetEditState(Object)
    GridTextBoxCellRenderer.WireModel(GridCellModelBase)
    GridTextBoxCellRenderer.UnwireModel(GridCellModelBase)
    GridTextBoxCellRenderer.Dispose(Boolean)
    GridTextBoxCellRenderer.CreateTextBox()
    GridTextBoxCellRenderer.TextBoxChanged(Object, EventArgs)
    GridTextBoxCellRenderer.OnSetControlText(String)
    GridTextBoxCellRenderer.ControlLostFocus(Object, EventArgs)
    GridTextBoxCellRenderer.ControlGotFocus(Object, EventArgs)
    GridTextBoxCellRenderer.TextBoxLostFocus(Object, EventArgs)
    GridTextBoxCellRenderer.TextBoxGotFocus(Object, EventArgs)
    GridTextBoxCellRenderer.OnInitialize(Int32, Int32)
    GridTextBoxCellRenderer.ModelUpdateActiveText()
    GridTextBoxCellRenderer.NotifyCurrentCellChanged()
    GridTextBoxCellRenderer.SetModelActiveText(String)
    GridTextBoxCellRenderer.GetSelectedText(String)
    GridTextBoxCellRenderer.ReplaceSel(String)
    GridTextBoxCellRenderer.OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
    GridTextBoxCellRenderer.OnClick(Int32, Int32, MouseEventArgs)
    GridTextBoxCellRenderer.OnDoubleClick(Int32, Int32, MouseEventArgs)
    GridTextBoxCellRenderer.OnHasFocusControlChanged()
    GridTextBoxCellRenderer.OnKeyPress(KeyPressEventArgs)
    GridTextBoxCellRenderer.SetTextBoxText(String, Boolean)
    GridTextBoxCellRenderer.SetSelectedText(String, Boolean)
    GridTextBoxCellRenderer.OnKeyDown(KeyEventArgs)
    GridTextBoxCellRenderer.CanCopy()
    GridTextBoxCellRenderer.CanPaste()
    GridTextBoxCellRenderer.CanCut()
    GridTextBoxCellRenderer.Cut()
    GridTextBoxCellRenderer.WantsAutoSize
    GridTextBoxCellRenderer.LimitTextLength
    GridTextBoxCellRenderer.TextBoxControl
    GridTextBoxCellRenderer.InTextBoxChanged
    GridTextBoxCellRenderer.TextBox
    GridTextBoxCellRenderer.IgnoreTextBoxChanged
    GridTextBoxCellRenderer.InNotifyCurrentCellChangedException
    GridTextBoxCellRenderer.InSetTextBoxTextCore
    GridTextBoxCellRenderer.TextBoxTextCore
    GridTextBoxCellRenderer.TextBoxText
    GridTextBoxCellRenderer.DisableTextBox
    GridStaticCellRenderer.RemoveMargins(Rectangle, GridStyleInfo)
    GridStaticCellRenderer.DrawImage(Graphics, ImageList, Int32, Rectangle, Boolean)
    GridStaticCellRenderer.DrawImage(Graphics, ImageList, Int32, Rectangle, Rectangle, Boolean)
    GridStaticCellRenderer.DrawImage(Graphics, ImageList, Int32, Rectangle)
    GridStaticCellRenderer.DrawText(Graphics, String, Font, Rectangle, GridStyleInfo, Color, Boolean)
    GridStaticCellRenderer.DrawText(Graphics, String, Font, Rectangle, GridStyleInfo, Color, Boolean, Boolean)
    GridStaticCellRenderer.GetRotatedTextBound(String, Font, StringFormat, Single, Single)
    GridStaticCellRenderer.DrawRotatedString(Graphics, String, Font, Brush, RectangleF, StringFormat, Single, GridStyleInfo)
    GridStaticCellRenderer.DrawText(Graphics, String, Font, Rectangle, GridStyleInfo, Color)
    GridStaticCellRenderer.IsPointOverImage(Int32, Int32, Point)
    GridCellRendererBase.Dispose()
    GridCellRendererBase.ProcessMouseWheel(MouseEventArgs)
    GridCellRendererBase.ToString()
    GridCellRendererBase.OnDeleting()
    GridCellRendererBase.OnModelChanged(EventArgs)
    GridCellRendererBase.OnDeactivating()
    GridCellRendererBase.OnDeactived(Int32, Int32)
    GridCellRendererBase.OnBeginEdit()
    GridCellRendererBase.OnEndEdit()
    GridCellRendererBase.QueryFocusInside()
    GridCellRendererBase.OnSaveChanges()
    GridCellRendererBase.OnRejectChanges()
    GridCellRendererBase.OnStartEditing()
    GridCellRendererBase.OnEditingComplete()
    GridCellRendererBase.OnValidated()
    GridCellRendererBase.OnActivating(Int32, Int32)
    GridCellRendererBase.ShouldDrawEditing(Int32, Int32)
    GridCellRendererBase.ShouldDrawFocused(Int32, Int32)
    GridCellRendererBase.NotifyCurrentCellChanging()
    GridCellRendererBase.NotifyCurrentCellControlDoubleClick(Control)
    GridCellRendererBase.ControlDoubleClick(Object, EventArgs)
    GridCellRendererBase.OnControlDoubleClick(Control)
    GridCellRendererBase.NotifyCurrentCellControlGotFocus(Control)
    GridCellRendererBase.NotifyCurrentCellControlLostFocus(Control)
    GridCellRendererBase.OnShowDropDown()
    GridCellRendererBase.OnCloseDropDown(PopupCloseType)
    GridCellRendererBase.OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs)
    GridCellRendererBase.OnOutlineCurrentCell(Graphics, Rectangle)
    GridCellRendererBase.OnCellLayoutChanged()
    GridCellRendererBase.OnGridGotFocus(EventArgs)
    GridCellRendererBase.ResetCellLayout()
    GridCellRendererBase.GetCellBoundsCore(Int32, Int32)
    GridCellRendererBase.GetCellBoundsCore(Int32, Int32, Boolean)
    GridCellRendererBase.GetCellBoundsCoreInt(Int32, Int32, Boolean)
    GridCellRendererBase.GetCellLayout(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.GetCellClientRectangle(Int32, Int32, GridStyleInfo, Boolean)
    GridCellRendererBase.PerformLayout(Int32, Int32)
    GridCellRendererBase.PerformLayout(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.PerformLayout(Int32, Int32, GridStyleInfo, Rectangle)
    GridCellRendererBase.OnLayout(Int32, Int32, GridStyleInfo, Rectangle, Rectangle[])
    GridCellRendererBase.DrawSingleCell(Graphics, Rectangle, Int32, Int32, GridStyleInfo, Boolean)
    GridCellRendererBase.Draw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
    GridCellRendererBase.OnDrawCellButton(GridCellButton, Graphics, Int32, Int32, Boolean, GridStyleInfo)
    GridCellRendererBase.OnDrawCellButtonBackground(GridCellButton, Graphics, Rectangle, ButtonState, GridStyleInfo)
    GridCellRendererBase.OnQueryShowButtons(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.AddButton(GridCellButton)
    GridCellRendererBase.RemoveButton(GridCellButton)
    GridCellRendererBase.GetButton(Int32)
    GridCellRendererBase.DrawBackground(Graphics, Rectangle, GridStyleInfo, Boolean)
    GridCellRendererBase.OnDrawCellBackground(GridDrawCellBackgroundEventArgs)
    GridCellRendererBase.DrawCellAppearance(Graphics, Rectangle, GridStyleInfo)
    GridCellRendererBase.GetMarkHeaderState(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.SetControl(Control)
    GridCellRendererBase.ResetControlText()
    GridCellRendererBase.UpdateControlValue()
    GridCellRendererBase.SetControlValue(Object, Boolean)
    GridCellRendererBase.ResetControlValue()
    GridCellRendererBase.GetDisplayText()
    GridCellRendererBase.GetCellValue()
    GridCellRendererBase.Initialize(Int32, Int32)
    GridCellRendererBase.InitializedAt(Int32, Int32)
    GridCellRendererBase.InitalizedAt(Int32, Int32)
    GridCellRendererBase.Hide()
    GridCellRendererBase.IsControlVisible()
    GridCellRendererBase.RaiseProcessKeyEventArgs(Message)
    GridCellRendererBase.ProcessKeyEventArgs(Message)
    GridCellRendererBase.OnKeyUp(KeyEventArgs)
    GridCellRendererBase.FindText(String, Int32, Int32, GridFindTextOptions, Boolean)
    GridCellRendererBase.OnNotifyMsg(Message)
    GridCellRendererBase.IsReadOnly()
    GridCellRendererBase.ValidateString(String)
    GridCellRendererBase.RaiseHitTest(Int32, Int32, MouseEventArgs, IMouseController)
    GridCellRendererBase.OnHitTest(Int32, Int32, MouseEventArgs, IMouseController)
    GridCellRendererBase.RaiseGetCursor(Int32, Int32)
    GridCellRendererBase.OnGetCursor(Int32, Int32)
    GridCellRendererBase.RaiseMouseHoverEnter(Int32, Int32)
    GridCellRendererBase.OnMouseHoverEnter(Int32, Int32)
    GridCellRendererBase.RaiseMouseHover(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseHover(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseMouseHoverLeave(Int32, Int32, EventArgs)
    GridCellRendererBase.OnMouseHoverLeave(Int32, Int32, EventArgs)
    GridCellRendererBase.RaiseMouseDown(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseDown(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.ControlMouseDown(Object, MouseEventArgs)
    GridCellRendererBase.RaiseMouseMove(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseMove(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseMouseUp(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseUp(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseCancelMode(Int32, Int32)
    GridCellRendererBase.OnCancelMode(Int32, Int32)
    GridCellRendererBase.RaiseClick(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseDoubleClick(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnButtonClicked(Int32, Int32, Int32)
    GridCellRendererBase.CreateDropDownContainer()
    GridCellRendererBase.EnsureDropDownContainer()
    GridCellRendererBase.InitializeDropDownContainer()
    GridCellRendererBase.ChildClosing(IPopupChild, PopupCloseType)
    GridCellRendererBase.DropDownContainerCloseDropDown(Object, PopupClosedEventArgs)
    GridCellRendererBase.IPopupParent.GetLocationForPopupAlignment(PopupRelativeAlignment, PopupRelativeAlignment)
    GridCellRendererBase.IPopupParent.GetBorderOverlapCue(PopupRelativeAlignment)
    GridCellRendererBase.DropDownContainerShowedDropDown(Object, EventArgs)
    GridCellRendererBase.DropDownContainerShowingDropDown(Object, CancelEventArgs)
    GridCellRendererBase.NotifyShowingDropDown(Size)
    GridCellRendererBase.NotifyShowedDropDown()
    GridCellRendererBase.IPopupItem.GetPopupParentControl()
    GridCellRendererBase.IsRelatedControl(Control, Boolean)
    GridCellRendererBase.OnScrollInView(GridScrollCurrentCellReason)
    GridCellRendererBase.GetNestedCurrentCell()
    GridCellRendererBase.ShouldRefreshCurrentCell()
    GridCellRendererBase.ScaleFactor
    GridCellRendererBase.IsDisposing
    GridCellRendererBase.IsDisposed
    GridCellRendererBase.DropDownImp
    GridCellRendererBase.Model
    GridCellRendererBase.CurrentCell
    GridCellRendererBase.InBeginEdit
    GridCellRendererBase.SupportsFocusControl
    GridCellRendererBase.SupportsEditing
    GridCellRendererBase.HasFocusControl
    GridCellRendererBase.IsEditing
    GridCellRendererBase.IsDroppedDown
    GridCellRendererBase.Control
    GridCellRendererBase.InSetControlText
    GridCellRendererBase.ControlText
    GridCellRendererBase.HasControlText
    GridCellRendererBase.InSetControlValue
    GridCellRendererBase.ControlValue
    GridCellRendererBase.InSetSetControlValue
    GridCellRendererBase.HasControlValue
    GridCellRendererBase.InInitialize
    GridCellRendererBase.CurrentStyle
    GridCellRendererBase.Initalized
    GridCellRendererBase.Grid
    GridCellRendererBase.StyleInfo
    GridCellRendererBase.ForceRefreshOnActivateCell
    GridCellRendererBase.RowIndex
    GridCellRendererBase.ColIndex
    GridCellRendererBase.MouseDownTick
    GridCellRendererBase.MouseDownPoint
    GridCellRendererBase.ClickOverImage
    GridCellRendererBase.AlwaysRaiseCellClick
    GridCellRendererBase.DropDownPart
    GridCellRendererBase.DropDownButton
    GridCellRendererBase.IPopupParent.IsRightToLeft
    GridCellRendererBase.DropDownContainer
    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.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public class GridFormulaCellRenderer : GridTextBoxCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
    Remarks

    See GridFormulaCellModel for a discussion about formula engine and customization.

    The following table lists some characteristics about the FormulaCell cell type:

    ItemDescription
    CellTypeFormulaCell
    RendererGridFormulaCellRenderer
    ModelGridFormulaCellModel
    XP Themes SupportNA
    InteractiveEdit with Text and Formula Input
    ControlGridTextBoxControl
    Floating SupportBoth
    Base TypeGridTextBoxCellRenderer

    The cell's behavior and appearance can be customized with the following properties of the GridStyleInfo class:

    PropertyNameDescription
    AllowEnter (System.Boolean)Gets / sets if pressing the <Enter>-Key should insert a new line into the edited text. (Default: False)
    AutoSize (System.Boolean)Gets / sets if the cell height should automatically increase when the edited text does not fit into the cell and WrapText is True. If WrapText is False, AutoSize will affect the column width. (Default: False)
    BaseStyle (System.String)The base style for this style instance with default values for properties that are not initialized for this style object. (Default: String.Empty)
    Borders (GridBordersInfo)Top, left, bottom, and right border settings. (Default: GridBordersInfo.Default)
    CellAppearance (GridCellAppearance)Specifies if cell edges shall be drawn raised, sunken, or flat (default). (Default: GridCellAppearance.Flat)
    CellTipText (System.String)ToolTip text to be displayed when user hovers mouse over cell. (Default: String.Empty)
    CellType (System.String)FormulaCell (Default: Text Box)
    CellValue (System.Object)This property holds the cell value. Although the cell value is typically a string, it can also be any other primitive type such as int, byte, enum, or any custom type that is derived from System.Object. (Default: String.Empty)
    CellValueType (System.Type)Specifies the preferred System.Type for cell values. When you assign a value to the GridStyleInfo object, the value will be converted to this type. If the value cannot be converted, Error will contain error information. (Default: NULL)
    CultureInfo (System.Globalization.CultureInfo)The culture information holds rules for parsing and formatting the cell's value. (Default: null)
    Enabled (System.Boolean)Specifies if the cell can be activated as current cell or if the cell should be skipped when moving the current cell. (Default: True)
    Error (System.String)Holds error information if a value could not be converted to the System.Type specified with CellValueType. (Default: String.Empty)
    FloatCell (System.Boolean)Gets / sets if text can float into the boundaries of a neighboring cell. (Default: True)
    FloodCell (System.Boolean)Gets / sets if this cell can be flooded by a previous cell. (Default: True)
    Font (GridFontInfo)The font for drawing text. (Default: GridFontInfo.Default)
    Format (System.String)Gets / sets the format mask for formatting the cell value. You can specify numeric format strings, date format strings or enumeration format strings as discussed in the section "Format Specifiers and Format Providers" of the .NET Framework Developers Guide (see ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconformatspecifiersformatproviders.htm) (Default: String.Empty)
    FormulaTag (GridFormulaTag)A formula tag that is associated with a cell. (Default: NULL)
    HorizontalAlignment (GridHorizontalAlignment)Specifies horizontal alignment of text in the cell. (Default: GridHorizontalAlignment.Left)
    HotkeyPrefix (System.Drawing.Text.HotkeyPrefix)Specifies how hot-key prefixes should be displayed. Hot-keys are indicated in text with an '&' (ampersand). When you enable a hot-key prefix, the specific characters can be displayed underlined or regular. The '&' will not be displayed. (Default: HotkeyPrefix.Show)
    ImageIndex (System.Int32)Specifies an index for an image in the ImageList of a GridStyleInfo instance. (Default: -1)
    ImageList (System.Windows.Forms.ImageList)The ImageList that holds a collection of images. Cells can choose images with the ImageIndex property in a GridStyleInfo instance. (Default: NULL)
    Interior (BrushInfo) Lets you specify a solid backcolor, gradient, or pattern style with both back and forecolor for a cell's background. (Default: SystemColors.Window)
    MaxLength (System.Int32)Limits the number of characters the user can type into the cell. Note: When selecting a text from a choice list or when pasting text, the text can be longer. Additional validation is necessary on your side. (Default: 0)
    MergeCell (GridMergeCellDirection)Specifies merge behavior for an individual cell when merging cells feature has been enabled in a GridModel with MergeCellsMode. (Default: GridMergeCellDirection.None)
    ReadOnly (System.Boolean)Specifies if cell contents can be modified by the user. You can programmatically change Read-only cells by setting DiscardReadOnly to True. (Default: False)
    Text (System.String)Gets / sets the value as a string. If a CellValueType is specified, the text will be parsed and converted to the type specified with CellValueType using any CultureInfo information. (Default: String.Empty)
    TextColor (System.Drawing.Color)Lets you specify the color for drawing the cell text. (Default: SystemColors.WindowText)
    TextMargins (GridMarginsInfo)Holds text margins in pixels. When drawing a cell, this specifies the empty area between the text rectangle and the client rectangle of the cell without borders and cell buttons. (Default: GridMarginsInfo.Default)
    Trimming (System.Drawing.StringTrimming)Indicates how text is trimmed when it exceeds the edges of the cell text rectangle. (Default: StringTrimming.Character)
    ValidateValue (GridCellValidateValueInfo)Holds validation rules for cell values that are being checked before any user changes are committed to the grid cell's style object. (Default: NULL)
    VerticalAlignment (GridVerticalAlignment)Specifies vertical alignment of text in the cell. (Default: GridVerticalAlignment.Top)
    VerticalScrollbar (System.Boolean)Specifies if text box should show a vertical scrollbar when text is being edited and does not fit in cell. WrapText must be initialized to True. (Default: False)
    WrapText (System.Boolean)Specifies if text should be wrapped when it does not fit into a single line. (Default: True)

    Constructors

    GridFormulaCellRenderer(GridControlBase, GridCellModelBase)

    Initializes a new GridFormulaCellRenderer object for the given GridControlBase and GridCellModelBase.

    Declaration
    public GridFormulaCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
    Parameters
    Type Name Description
    GridControlBase grid

    The GridControlBase that displays this cell renderer.

    GridCellModelBase cellModel

    The GridCellModelBase that holds data for this cell renderer that should be shared among views.

    Remarks

    References to GridControlBase, and GridCellModelBase will be saved.

    Properties

    ForceEditWhenActivated

    Gets or sets a value indicating whether GridFormulaCellRenderer should honor the ActivateCurrentCellBehavior and only start editing mode as specified in that setting or if it should ignore that setting and always switch into edit mode as soon as it is activated.

    Declaration
    public static bool ForceEditWhenActivated { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Copy()

    Called when user initiates ClipboardCopy operation. Used for a single cell only. Returns True if successful; False if failed.

    Declaration
    public override bool Copy()
    Returns
    Type Description
    System.Boolean

    returns False.

    Overrides
    GridTextBoxCellRenderer.Copy()

    GetCellText(GridStyleInfo, GridFindTextOptions)

    Get the text of particular cell

    Declaration
    protected override string GetCellText(GridStyleInfo style, GridFindTextOptions options)
    Parameters
    Type Name Description
    GridStyleInfo style

    style of the cell

    GridFindTextOptions options

    GridFindTextOptions

    Returns
    Type Description
    System.String

    Text

    Overrides
    GridCellRendererBase.GetCellText(GridStyleInfo, GridFindTextOptions)

    InitializeControlText(Object)

    Initializes ControlText based on the specified cell value.

    Declaration
    protected override void InitializeControlText(object controlValue)
    Parameters
    Type Name Description
    System.Object controlValue

    The Control text value.

    Overrides
    GridCellRendererBase.InitializeControlText(Object)

    OnActivated()

    This is called after the activating event and notifies that at this time the current cell has now become the active current cell.

    Declaration
    protected override void OnActivated()
    Overrides
    GridCellRendererBase.OnActivated()

    OnValidate()

    This method is called from GridCurrentCell.Validate after GridCurrentCell.Validating event has been fired. The default version checks if the active text fits any criteria as specified in the style object: It can be parsed into a cell value and meets GridCellValidateValueInfo criteria.

    Declaration
    protected override bool OnValidate()
    Returns
    Type Description
    System.Boolean

    True if the modified text is valid; False otherwise.

    Overrides
    GridCellRendererBase.OnValidate()

    Paste()

    Called when user initiates ClipboardPaste operation. True if successful; False if failed.

    Declaration
    public override bool Paste()
    Returns
    Type Description
    System.Boolean

    returns False.

    Overrides
    GridTextBoxCellRenderer.Paste()

    ReplaceText(String, String, Int32, Int32, GridFindTextOptions, Boolean)

    Searches the specified text and optionally moves the current cell to the cell if the text was found.

    Declaration
    public override bool ReplaceText(string find, string replace, int rowIndex, int colIndex, GridFindTextOptions options, bool bSetCell)
    Parameters
    Type Name Description
    System.String find

    The text to be searched.

    System.String replace

    The replace text.

    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    GridFindTextOptions options

    Search criteria.

    System.Boolean bSetCell

    True if current cell should be moved after text was found.

    Returns
    Type Description
    System.Boolean

    True if text was found; False otherwise.

    Overrides
    GridCellRendererBase.ReplaceText(String, String, Int32, Int32, GridFindTextOptions, Boolean)

    Implements

    IQueryFocusInside
    IGridDropDownCell
    IPopupParent
    IPopupItem
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved