menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridAwareTextBox - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridAwareTextBox

    Provides support for dynamically displays and edits the contents of the CurrentCell of a grid.

    Inheritance
    System.Object
    GridAwareTextBox
    Namespace: Syncfusion.Windows.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public class GridAwareTextBox : TextBox
    Remarks

    You can drop this text box anywhere on a form, and use its WireGrid method to bind it to the CurrentCell of a grid. So, any changes in the text box are reflected in the CurrentCell of the grid, and any changes to the CurrentCell are reflected in the text box.

    Constructors

    GridAwareTextBox()

    Initializes a new instance for GridAwareTextBoxclass.

    Declaration
    public GridAwareTextBox()

    Properties

    AutoSuggestFormula

    Gets or sets a value indicating whether to enable / disable AutoSuggestFormula in GridAwareTextBox

    Declaration
    public bool AutoSuggestFormula { get; set; }
    Property Value
    Type
    System.Boolean

    BackColor

    Hides the base.BackColor.

    Declaration
    public override Color BackColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    CausesValidation

    Gets or sets a value indicating whether to cause validation. Force a false setting.

    Declaration
    public bool CausesValidation { get; set; }
    Property Value
    Type
    System.Boolean

    DisabledBackColor

    Gets or sets color of the text box background when the grid cell is not editable for some reason.

    Declaration
    public Color DisabledBackColor { get; set; }
    Property Value
    Type
    System.Drawing.Color
    Remarks

    This color is used for the text box back color when the current grid cell is not editable, or if there is no current grid cell. You can set it to SystemColors.Control to see a a standard gray disabled background.

    EnabledBackColor

    Gets or sets color of the background of the text box when the current grid cell is editable.

    Declaration
    public Color EnabledBackColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    EnableTouchMode

    Gets or sets the TouchMode for the control.

    Declaration
    public virtual bool EnableTouchMode { get; set; }
    Property Value
    Type
    System.Boolean

    Text

    Force an empty initial string.

    Declaration
    public override string Text { get; set; }
    Property Value
    Type
    System.String

    Methods

    ApplyScaleToControl(Single)

    Applies the scaling for the control.

    Declaration
    public void ApplyScaleToControl(float sf)
    Parameters
    Type Name Description
    System.Single sf

    float value.

    Dispose(Boolean)

    Overridden to unwire the grid.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    GetCurrentCell()

    Returns the CurrentCell of the wired grid.

    Declaration
    protected GridCurrentCell GetCurrentCell()
    Returns
    Type Description
    GridCurrentCell

    The CurrentCell.

    GridCurrentCellActivated(Object, EventArgs)

    Handles the CurrentCellActivated event of the System.EventArgs.

    Declaration
    protected virtual void GridCurrentCellActivated(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event.

    System.EventArgs e

    The event data.

    Remarks

    The GridCurrentCellActivated is called when the user enters into the grid cell. The default behavior is to set the text in the GridAwareTextBox to the current text that is stored in the cell's GridStyleInfo object. Override this method to modify this behavior or to add additional actions when the user enters the grid cell.

    GridCurrentCellChanged(Object, EventArgs)

    Handles the CurrentCellChanged event of the System.EventArgs.

    Declaration
    protected virtual void GridCurrentCellChanged(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event.

    System.EventArgs e

    The event data.

    Remarks

    The GridCurrentCellChanged is called when the user modifies the text in the grid cell. The default behavior is to set the text in the GridAwareTextBox to the ControlText from the CurrentCell renderer. Override this method to modify this behavior or to add additional actions when the user types the text within the grid cell.

    GridCurrentCellRejectedChanges(Object, EventArgs)

    Handles the CurrentCellRejectedChanges event of the System.EventArgs.

    Declaration
    protected virtual void GridCurrentCellRejectedChanges(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    The source of the event.

    System.EventArgs e

    The event data.

    Remarks

    The GridCurrentCellRejectedChanges is called when the user presses the escape while editing a cell in the grid. The default behavior is to reset the text in the GridAwareTextBox to the current text that is stored in the cell's GridStyleInfo object. Override this method to modify this behavior or to add additional actions when the user presses escape while editing within the grid cell.

    OnFontChanged(EventArgs)

    Used to change the behavior of the font

    Declaration
    protected override void OnFontChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The System.EventArgsthat contains event data.

    OnKeyDown(KeyEventArgs)

    Overridden to make the grid process the Enter key.

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.KeyEventArgs e

    The System.Windows.Forms.KeyEventArgsthat contains event data.

    OnKeyUp(KeyEventArgs)

    Raises the System.Windows.Forms.Control.KeyUp event.

    Declaration
    protected override void OnKeyUp(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.KeyEventArgs e

    The System.Windows.Forms.KeyEventArgsthat contains event data.

    OnMouseUp(MouseEventArgs)

    Raises the System.Windows.Forms.Control.MouseUp event.

    Declaration
    protected override void OnMouseUp(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    The System.Windows.Forms.MouseEventArgsthat contains event data.

    OnSizeChanged(EventArgs)

    Used to change the size.

    Declaration
    protected override void OnSizeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The System.EventArgsthat contains event data.

    OnTextChanged(EventArgs)

    This event fired when TextBox text changed.

    Declaration
    protected override void OnTextChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The System.EventArgsthat contains event data.

    OnVisibleChanged(EventArgs)

    Declaration
    protected override void OnVisibleChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    SetText(String)

    Sets the Text property of the GridAwareTextBox without raising a TextChanged event.

    Declaration
    protected void SetText(string text)
    Parameters
    Type Name Description
    System.String text

    The text to be set.

    UnwireGrid(GridControlBase)

    Removes the binding between this text box and the CurrentCell of the grid.

    Declaration
    public virtual void UnwireGrid(GridControlBase grid)
    Parameters
    Type Name Description
    GridControlBase grid

    The GridControlBase whose CurrentCell is being bound.

    WireGrid(GridControlBase)

    Use to bind this text box to the CurrentCell of a GridControlBase.

    Declaration
    public virtual void WireGrid(GridControlBase grid)
    Parameters
    Type Name Description
    GridControlBase grid

    The GridControlBase whose CurrentCell is being bound.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved