menu

WinForms

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

    Show / Hide Table of Contents

    Class GridTextBoxCellRenderer

    Implements the renderer part of a text box cell.

    Inheritance
    System.Object
    NonFinalizeDisposable
    GridCellRendererBase
    GridStaticCellRenderer
    GridTextBoxCellRenderer
    ButtonEditCellRenderer
    LinkLabelCellRenderer
    PercentTextBoxCellRenderer
    GridDataBoundTreeCellRenderer
    GridDropDownCellRenderer
    GridFormulaCellRenderer
    GridNumericUpDownCellRenderer
    GridOriginalTextBoxCellRenderer
    PivotGridTotalCellRenderer
    PivotGridTotalValueCellRenderer
    Implements
    IQueryFocusInside
    IGridDropDownCell
    IPopupParent
    IPopupItem
    System.IDisposable
    Inherited Members
    GridCellRendererBase.AddButton(GridCellButton)
    GridCellRendererBase.AlwaysRaiseCellClick
    GridCellRendererBase.ChildClosing(IPopupChild, PopupCloseType)
    GridCellRendererBase.ClickOverImage
    GridCellRendererBase.ColIndex
    GridCellRendererBase.Control
    GridCellRendererBase.ControlDoubleClick(Object, EventArgs)
    GridCellRendererBase.ControlMouseDown(Object, MouseEventArgs)
    GridCellRendererBase.ControlText
    GridCellRendererBase.ControlValue
    GridCellRendererBase.CreateDropDownContainer()
    GridCellRendererBase.CurrentCell
    GridCellRendererBase.CurrentStyle
    GridCellRendererBase.Dispose()
    GridCellRendererBase.Draw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
    GridCellRendererBase.DrawBackground(Graphics, Rectangle, GridStyleInfo, Boolean)
    GridCellRendererBase.DrawCellAppearance(Graphics, Rectangle, GridStyleInfo)
    GridCellRendererBase.DrawSingleCell(Graphics, Rectangle, Int32, Int32, GridStyleInfo, Boolean)
    GridCellRendererBase.DropDownButton
    GridCellRendererBase.DropDownContainer
    GridCellRendererBase.DropDownContainerCloseDropDown(Object, PopupClosedEventArgs)
    GridCellRendererBase.DropDownContainerShowedDropDown(Object, EventArgs)
    GridCellRendererBase.DropDownContainerShowingDropDown(Object, CancelEventArgs)
    GridCellRendererBase.DropDownImp
    GridCellRendererBase.DropDownPart
    GridCellRendererBase.EnsureDropDownContainer()
    GridCellRendererBase.FindText(String, Int32, Int32, GridFindTextOptions, Boolean)
    GridCellRendererBase.ForceRefreshOnActivateCell
    GridCellRendererBase.GetButton(Int32)
    GridCellRendererBase.GetCellBoundsCore(Int32, Int32)
    GridCellRendererBase.GetCellBoundsCore(Int32, Int32, Boolean)
    GridCellRendererBase.GetCellBoundsCoreInt(Int32, Int32, Boolean)
    GridCellRendererBase.GetCellClientRectangle(Int32, Int32, GridStyleInfo, Boolean)
    GridCellRendererBase.GetCellLayout(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.GetCellText(GridStyleInfo, GridFindTextOptions)
    GridCellRendererBase.GetCellValue()
    GridCellRendererBase.GetDisplayText()
    GridCellRendererBase.GetMarkHeaderState(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.GetNestedCurrentCell()
    GridCellRendererBase.Grid
    GridCellRendererBase.HasControlText
    GridCellRendererBase.HasControlValue
    GridCellRendererBase.HasFocusControl
    GridCellRendererBase.Hide()
    GridCellRendererBase.InBeginEdit
    GridCellRendererBase.InInitialize
    GridCellRendererBase.Initalized
    GridCellRendererBase.InitalizedAt(Int32, Int32)
    GridCellRendererBase.Initialize(Int32, Int32)
    GridCellRendererBase.InitializeControlText(Object)
    GridCellRendererBase.InitializedAt(Int32, Int32)
    GridCellRendererBase.InitializeDropDownContainer()
    GridCellRendererBase.InSetControlText
    GridCellRendererBase.InSetControlValue
    GridCellRendererBase.InSetSetControlValue
    GridCellRendererBase.IPopupItem.GetPopupParentControl()
    GridCellRendererBase.IPopupParent.GetBorderOverlapCue(PopupRelativeAlignment)
    GridCellRendererBase.IPopupParent.GetLocationForPopupAlignment(PopupRelativeAlignment, PopupRelativeAlignment)
    GridCellRendererBase.IPopupParent.IsRightToLeft
    GridCellRendererBase.IsControlVisible()
    GridCellRendererBase.IsDisposed
    GridCellRendererBase.IsDisposing
    GridCellRendererBase.IsDroppedDown
    GridCellRendererBase.IsEditing
    GridCellRendererBase.IsReadOnly()
    GridCellRendererBase.IsRelatedControl(Control, Boolean)
    GridCellRendererBase.Model
    GridCellRendererBase.MouseDownPoint
    GridCellRendererBase.MouseDownTick
    GridCellRendererBase.NotifyCurrentCellChanging()
    GridCellRendererBase.NotifyCurrentCellControlDoubleClick(Control)
    GridCellRendererBase.NotifyCurrentCellControlGotFocus(Control)
    GridCellRendererBase.NotifyCurrentCellControlLostFocus(Control)
    GridCellRendererBase.NotifyShowedDropDown()
    GridCellRendererBase.NotifyShowingDropDown(Size)
    GridCellRendererBase.OnActivated()
    GridCellRendererBase.OnActivating(Int32, Int32)
    GridCellRendererBase.OnBeginEdit()
    GridCellRendererBase.OnButtonClicked(Int32, Int32, Int32)
    GridCellRendererBase.OnCancelMode(Int32, Int32)
    GridCellRendererBase.OnCellLayoutChanged()
    GridCellRendererBase.OnCloseDropDown(PopupCloseType)
    GridCellRendererBase.OnControlDoubleClick(Control)
    GridCellRendererBase.OnDeactivating()
    GridCellRendererBase.OnDeactived(Int32, Int32)
    GridCellRendererBase.OnDeleting()
    GridCellRendererBase.OnDrawCellBackground(GridDrawCellBackgroundEventArgs)
    GridCellRendererBase.OnDrawCellButton(GridCellButton, Graphics, Int32, Int32, Boolean, GridStyleInfo)
    GridCellRendererBase.OnDrawCellButtonBackground(GridCellButton, Graphics, Rectangle, ButtonState, GridStyleInfo)
    GridCellRendererBase.OnEditingComplete()
    GridCellRendererBase.OnEndEdit()
    GridCellRendererBase.OnGetCursor(Int32, Int32)
    GridCellRendererBase.OnGridGotFocus(EventArgs)
    GridCellRendererBase.OnHitTest(Int32, Int32, MouseEventArgs, IMouseController)
    GridCellRendererBase.OnKeyUp(KeyEventArgs)
    GridCellRendererBase.OnLayout(Int32, Int32, GridStyleInfo, Rectangle, Rectangle[])
    GridCellRendererBase.OnModelChanged(EventArgs)
    GridCellRendererBase.OnMouseDown(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseHover(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseHoverEnter(Int32, Int32)
    GridCellRendererBase.OnMouseHoverLeave(Int32, Int32, EventArgs)
    GridCellRendererBase.OnMouseMove(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnMouseUp(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnNotifyMsg(Message)
    GridCellRendererBase.OnOutlineCurrentCell(Graphics, Rectangle)
    GridCellRendererBase.OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs)
    GridCellRendererBase.OnQueryShowButtons(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.OnRejectChanges()
    GridCellRendererBase.OnSaveChanges()
    GridCellRendererBase.OnScrollInView(GridScrollCurrentCellReason)
    GridCellRendererBase.OnShowDropDown()
    GridCellRendererBase.OnStartEditing()
    GridCellRendererBase.OnValidate()
    GridCellRendererBase.OnValidated()
    GridCellRendererBase.PerformLayout(Int32, Int32)
    GridCellRendererBase.PerformLayout(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.PerformLayout(Int32, Int32, GridStyleInfo, Rectangle)
    GridCellRendererBase.ProcessKeyEventArgs(Message)
    GridCellRendererBase.ProcessMouseWheel(MouseEventArgs)
    GridCellRendererBase.QueryFocusInside()
    GridCellRendererBase.RaiseCancelMode(Int32, Int32)
    GridCellRendererBase.RaiseClick(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseDoubleClick(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseGetCursor(Int32, Int32)
    GridCellRendererBase.RaiseHitTest(Int32, Int32, MouseEventArgs, IMouseController)
    GridCellRendererBase.RaiseMouseDown(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseMouseHover(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseMouseHoverEnter(Int32, Int32)
    GridCellRendererBase.RaiseMouseHoverLeave(Int32, Int32, EventArgs)
    GridCellRendererBase.RaiseMouseMove(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseMouseUp(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseProcessKeyEventArgs(Message)
    GridCellRendererBase.RemoveButton(GridCellButton)
    GridCellRendererBase.ReplaceText(String, String, Int32, Int32, GridFindTextOptions, Boolean)
    GridCellRendererBase.ResetCellLayout()
    GridCellRendererBase.ResetControlText()
    GridCellRendererBase.ResetControlValue()
    GridCellRendererBase.RowIndex
    GridCellRendererBase.ScaleFactor
    GridCellRendererBase.SetControl(Control)
    GridCellRendererBase.SetControlValue(Object, Boolean)
    GridCellRendererBase.ShouldDrawEditing(Int32, Int32)
    GridCellRendererBase.ShouldDrawFocused(Int32, Int32)
    GridCellRendererBase.ShouldRefreshCurrentCell()
    GridCellRendererBase.StyleInfo
    GridCellRendererBase.SupportsEditing
    GridCellRendererBase.SupportsFocusControl
    GridCellRendererBase.ToString()
    GridCellRendererBase.UpdateControlValue()
    GridCellRendererBase.ValidateString(String)
    GridStaticCellRenderer.DrawImage(Graphics, ImageList, Int32, Rectangle)
    GridStaticCellRenderer.DrawImage(Graphics, ImageList, Int32, Rectangle, Boolean)
    GridStaticCellRenderer.DrawImage(Graphics, ImageList, Int32, Rectangle, Rectangle, Boolean)
    GridStaticCellRenderer.DrawRotatedString(Graphics, String, Font, Brush, RectangleF, StringFormat, Single, GridStyleInfo)
    GridStaticCellRenderer.DrawText(Graphics, String, Font, Rectangle, GridStyleInfo, Color)
    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.IsPointOverImage(Int32, Int32, Point)
    GridStaticCellRenderer.RemoveMargins(Rectangle, GridStyleInfo)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Syncfusion.Windows.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public class GridTextBoxCellRenderer : GridStaticCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
    Remarks

    Use "text box" as identifier in CellType of a cells GridStyleInfo to associate this cell type with a cell.

    A renderer is created for each GridCellModelBase and GridControlBase. There can be several renderers associated with one GridTextBoxCellModel if several views display the same GridModel.

    The following table lists some characteristics about the text box cell type.

    ItemDescription
    CellTypeText Box
    RendererGridTextBoxCellRenderer
    ModelGridTextBoxCellModel
    XP Themes SupportNA
    InteractiveEdit with Text Input
    ControlGridTextBoxControl
    Floating SupportBoth
    Base TypeGridStaticCellRenderer

    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)
    BackgroundImage (System.Drawing.Image)Gets / sets the image that the cell displays as background. (Default: null)
    BackgroundImageMode (GridBackgroundImageMode)Indicates how the background image is displayed. (Default: GridBackgroundImageMode)
    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)Text Box (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 cells 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)
    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 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 back color, gradient, or pattern style with both back and fore color 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 text from 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 programatically change Read-only cells by setting DiscardReadOnly to True. (Default: False)
    StrictValueType (System.Boolean)Indicates whether an exception should be thrown in the ApplyFormattedText(String) method if the formatted text can not be parsed or converted to the type specified with CellValueType (Default: true)
    Text (System.String)Gets / sets the value as a string. If a CellValueType is specified, the text will be parsed or 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 the cell value 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

    GridTextBoxCellRenderer(GridControlBase, GridCellModelBase)

    Initializes a new instance of the GridTextBoxCellRenderer class, for the given GridControlBase and GridCellModelBase.

    Declaration
    public GridTextBoxCellRenderer(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

    DisableTextBox

    Gets or sets a value indicating whether the text box should be hidden. This is useful for derived cell renderers that want to be able to switch between a edit-mode and static mode, e.g. a drop-down list does not need to have text input capabilities.

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

    When disabled, you can still call TextBoxText to change the text for the active cell. In this case TextBoxText will save the text in a member variable and simply draw the text by itself.

    IgnoreTextBoxChanged

    Gets or sets a value indicating whether TextBoxChanged events should be ignored.

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

    InNotifyCurrentCellChangedException

    Gets a value indicating whether InNotifyCurrentCellChangedException. Internal only.

    Declaration
    public bool InNotifyCurrentCellChangedException { get; }
    Property Value
    Type Description
    System.Boolean

    true if [in notify current cell changed exception]; otherwise, false.

    InSetTextBoxTextCore

    Gets a value indicating whether InSetTextBoxTextCore. Internal only.

    Declaration
    public bool InSetTextBoxTextCore { get; }
    Property Value
    Type Description
    System.Boolean

    true if [in set text box text core]; otherwise, false.

    InTextBoxChanged

    Used internally.

    Declaration
    protected bool InTextBoxChanged { get; set; }
    Property Value
    Type
    System.Boolean

    LimitTextLength

    Used internally.

    Declaration
    protected int LimitTextLength { get; set; }
    Property Value
    Type
    System.Int32

    TextBox

    Gets the text box that is shown in-place in the cell when the user starts editing the cell.

    Declaration
    public TextBoxBase TextBox { get; }
    Property Value
    Type
    System.Windows.Forms.TextBoxBase

    TextBoxControl

    Used internally.

    Declaration
    protected TextBoxBase TextBoxControl { get; set; }
    Property Value
    Type
    System.Windows.Forms.TextBoxBase

    TextBoxText

    Gets or sets the current text in the TextBox.

    Declaration
    protected virtual string TextBoxText { get; set; }
    Property Value
    Type
    System.String
    Remarks

    When you change this text, the setter of this property will ensure the cell is not Read-only, raise a CurrentCellChanging change the text and after successful change, raise a CurrentCellChanged event and force a refresh of the cell.

    TextBoxTextCore

    Gets or sets the TextBoxTextCore. Internal only.

    Declaration
    public string TextBoxTextCore { get; set; }
    Property Value
    Type Description
    System.String

    The text box text core.

    WantsAutoSize

    Used internally.

    Declaration
    protected bool WantsAutoSize { get; set; }
    Property Value
    Type
    System.Boolean

    Methods

    CanCopy()

    Determines whether current cell can be copied to clipboard.

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

    Returns True.

    Overrides
    GridStaticCellRenderer.CanCopy()

    CanCut()

    Determines whether the current cell can be cut to clipboard.

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

    True if this operation is allowed.

    Overrides
    GridStaticCellRenderer.CanCut()

    CanPaste()

    Determines whether the current cell can be pasted from clipboard.

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

    True if it is allowed.

    Overrides
    GridCellRendererBase.CanPaste()

    ControlGotFocus(Object, EventArgs)

    Declaration
    protected override sealed void ControlGotFocus(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e
    Overrides
    GridCellRendererBase.ControlGotFocus(Object, EventArgs)

    ControlLostFocus(Object, EventArgs)

    Declaration
    protected override sealed void ControlLostFocus(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e
    Overrides
    GridCellRendererBase.ControlLostFocus(Object, EventArgs)

    Copy()

    Called when user initiates a clipboard copy and works with a single cell only.

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

    True if the operation is successful.

    Overrides
    GridCellRendererBase.Copy()

    CreateTextBox()

    Creates the text box that is shown in-place in the cell when the user starts editing the cell.

    Declaration
    protected virtual TextBoxBase CreateTextBox()
    Returns
    Type Description
    System.Windows.Forms.TextBoxBase

    Returns the new instance of the GridTextBoxControl.

    Cut()

    Called when user initiates a clipboard cut and works with a single cell only.

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

    True if the operation is successful.

    Overrides
    GridCellRendererBase.Cut()

    Dispose(Boolean)

    Disposes the unmanaged resources.

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

    GetEditState()

    Returns the state information that lets you restore the current edit state.

    Declaration
    public override object GetEditState()
    Returns
    Type Description
    System.Object

    State information.

    Overrides
    GridCellRendererBase.GetEditState()

    GetSelectedText(out String)

    Gets the selected text in the current cell.

    Declaration
    public override bool GetSelectedText(out string strResult)
    Parameters
    Type Name Description
    System.String strResult

    A string with the selected text.

    Returns
    Type Description
    System.Boolean

    True if the operation is successful.

    Overrides
    GridCellRendererBase.GetSelectedText(out String)

    ModelUpdateActiveText()

    Calls SetActiveText(Int32, Int32, String) on the GridCellModelBase

    Declaration
    protected void ModelUpdateActiveText()

    NotifyCurrentCellChanged()

    Raises the GridCurrentCell.CellChanged event indicating the contents of the current cell have been changed (e.g. in response to a TextBox.Changed event).

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

    OnClick(Int32, Int32, MouseEventArgs)

    Called when the user clicked inside a cell.

    Declaration
    protected override void OnClick(int rowIndex, int colIndex, MouseEventArgs e)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    System.Windows.Forms.MouseEventArgs e

    A System.Windows.Forms.MouseEventArgs with data about the mouse event.

    Overrides
    GridCellRendererBase.OnClick(Int32, Int32, MouseEventArgs)

    OnDoubleClick(Int32, Int32, MouseEventArgs)

    Called when the user double-clicks inside a cell.

    Declaration
    protected override void OnDoubleClick(int rowIndex, int colIndex, MouseEventArgs e)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    System.Windows.Forms.MouseEventArgs e

    A System.Windows.Forms.MouseEventArgs with data about the mouse event.

    Overrides
    GridCellRendererBase.OnDoubleClick(Int32, Int32, MouseEventArgs)

    OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)

    This method is called from the cell renderer's draw method to draw the contents of the client bounds for the cell, e.g. the text for a static cell.

    Declaration
    protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    Points to the device context.

    System.Drawing.Rectangle clientRectangle

    Specifies the client rectangle. It is the cell rectangle without buttons and borders.

    System.Int32 rowIndex

    Specifies the row id.

    System.Int32 colIndex

    Specifies the column id.

    GridStyleInfo style

    The GridStyleInfo object holds the style information of a cell.

    Overrides
    GridStaticCellRenderer.OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)

    OnHasFocusControlChanged()

    Define this method if your cell renderer supports in-place editing and you want to do any custom initialization at this point before cell gets redrawn.

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

    OnInitialize(Int32, Int32)

    Called from Initialize after currentRowIndex, inInitialize are set and PerformLayout finished.

    Declaration
    protected override void OnInitialize(int rowIndex, int colIndex)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    Specifies the row id.

    System.Int32 colIndex

    Specifies the column id.

    Overrides
    GridCellRendererBase.OnInitialize(Int32, Int32)

    OnKeyDown(KeyEventArgs)

    Raises the event when user pressed key down.

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

    An System.Windows.Forms.KeyEventArgs that contains event data.

    Overrides
    GridCellRendererBase.OnKeyDown(KeyEventArgs)

    OnKeyPress(KeyPressEventArgs)

    Raises the event when user pressed key.

    Declaration
    protected override void OnKeyPress(KeyPressEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.KeyPressEventArgs e

    A System.Windows.Forms.KeyEventArgs with data of the keyboard event.

    Overrides
    GridCellRendererBase.OnKeyPress(KeyPressEventArgs)

    OnSetControlText(String)

    Sets the control text.

    Declaration
    protected override void OnSetControlText(string text)
    Parameters
    Type Name Description
    System.String text
    Overrides
    GridCellRendererBase.OnSetControlText(String)

    Paste()

    Called when user initiates a clipboard paste and works only with a single cell.

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

    True if the operation is successful.

    Overrides
    GridCellRendererBase.Paste()

    ReplaceSel(String)

    Replaces the selected text in the current cell.

    Declaration
    public override void ReplaceSel(string replacement)
    Parameters
    Type Name Description
    System.String replacement

    String to replace the current selected text.

    Overrides
    GridCellRendererBase.ReplaceSel(String)

    SetEditState(Object)

    Restores previously retrieved editing state information from a GetEditState call.

    Declaration
    public override void SetEditState(object state)
    Parameters
    Type Name Description
    System.Object state

    The cell-type specific object with the edit state information.

    Overrides
    GridCellRendererBase.SetEditState(Object)

    SetModelActiveText(String)

    Calls SetActiveText(Int32, Int32, String) and ensures that ActiveTextChanged event is ignored for the current renderer. Only other renderers in other grid views will handle the ActiveTextChanged event.

    Declaration
    protected void SetModelActiveText(string value)
    Parameters
    Type Name Description
    System.String value

    The text to be set.

    SetSelectedText(String, Boolean)

    Sets the TextBox.SelectedText of the text box and optionally validates the string with a ValidateString(String) call.

    Declaration
    public bool SetSelectedText(string text, bool validate)
    Parameters
    Type Name Description
    System.String text

    The text that should replace the current selected text in the text box.

    System.Boolean validate

    Indicates if ValidateString(String) should be called.

    Returns
    Type Description
    System.Boolean

    True if text was valid and could be copied to the text box.

    Remarks

    The method raises a CurrentCellChanged event after the text was modified.

    Note: This is a low-level method. The method does not raise CurrentCellChanging and also does not check if the current cell is already in editing mode.

    SetTextBoxText(String, Boolean)

    Sets the TextBox.Text of the text box and optionally validates the string with a ValidateString(String) call.

    Declaration
    public bool SetTextBoxText(string s, bool validate)
    Parameters
    Type Name Description
    System.String s

    The text to be displayed.

    System.Boolean validate

    Indicates if ValidateString(String) should be called.

    Returns
    Type Description
    System.Boolean

    True if text was valid and could be copied to the text box.

    Remarks

    The method will also raises a cancelable CurrentCellChanging event if the text was not modified.

    TextBoxChanged(Object, EventArgs)

    Occurs when the System.Windows.Forms.Control.TextChanged event of the TextBox is raised.

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

    The source of the event.

    System.EventArgs e

    An System.EventArgsthat contains event data.

    TextBoxGotFocus(Object, EventArgs)

    Handles the System.Windows.Forms.Control.GotFocus event of the text box and raises a CurrentCellControlGotFocus event.

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

    The source of the event.

    System.EventArgs e

    An System.EventArgsthat contains event data.

    TextBoxLostFocus(Object, EventArgs)

    Handles the System.Windows.Forms.Control.LostFocus event of the text box and raise a CurrentCellControlLostFocus event.

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

    The source of the event.

    System.EventArgs e

    An System.EventArgsthat contains event data.

    UnwireModel(GridCellModelBase)

    Unwires the event.

    Declaration
    protected override void UnwireModel(GridCellModelBase cellModel)
    Parameters
    Type Name Description
    GridCellModelBase cellModel
    Overrides
    GridCellRendererBase.UnwireModel(GridCellModelBase)

    WireModel(GridCellModelBase)

    Wires the ActiveTextChanged event.

    Declaration
    protected override void WireModel(GridCellModelBase cellModel)
    Parameters
    Type Name Description
    GridCellModelBase cellModel
    Overrides
    GridCellRendererBase.WireModel(GridCellModelBase)

    Implements

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