menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridDataBoundRowHeaderCellRenderer - API Reference

    Show / Hide Table of Contents

    Class GridDataBoundRowHeaderCellRenderer

    Implements the renderer part of a row header cell in a GridDataBoundGrid. The row header cell will display an arrow for the current row, a star for the append row, and a pencil when the row is being edited.

    Inheritance
    System.Object
    NonFinalizeDisposable
    GridCellRendererBase
    GridStaticCellRenderer
    GridHeaderCellRenderer
    GridDataBoundRowHeaderCellRenderer
    Implements
    IQueryFocusInside
    IGridDropDownCell
    IPopupParent
    IPopupItem
    System.IDisposable
    Inherited Members
    GridHeaderCellRenderer.WireGrid()
    GridHeaderCellRenderer.UnwireGrid()
    GridHeaderCellRenderer.Dispose(Boolean)
    GridHeaderCellRenderer.OnHitTest(Int32, Int32, MouseEventArgs, IMouseController)
    GridHeaderCellRenderer.OnMouseMove(Int32, Int32, MouseEventArgs)
    GridHeaderCellRenderer.OnMouseHover(Int32, Int32, MouseEventArgs)
    GridHeaderCellRenderer.OnMouseDown(Int32, Int32, MouseEventArgs)
    GridHeaderCellRenderer.OnMouseUp(Int32, Int32, MouseEventArgs)
    GridHeaderCellRenderer.OnMouseHoverLeave(Int32, Int32, EventArgs)
    GridHeaderCellRenderer.DrawMetroHeaderStyle(Graphics, Rectangle, ThemedHeaderDrawing.HeaderState)
    GridHeaderCellRenderer.DrawMetroCaptionRowStyle(Graphics, Rectangle, ThemedHeaderDrawing.HeaderState)
    GridHeaderCellRenderer.OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs)
    GridHeaderCellRenderer.OnDrawCellBackground(GridDrawCellBackgroundEventArgs)
    GridHeaderCellRenderer.OnOutlineCurrentCell(Graphics, Rectangle)
    GridStaticCellRenderer.CanCopy()
    GridStaticCellRenderer.CanCut()
    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.GetEditState()
    GridCellRendererBase.SetEditState(Object)
    GridCellRendererBase.ToString()
    GridCellRendererBase.OnDeleting()
    GridCellRendererBase.UnwireModel(GridCellModelBase)
    GridCellRendererBase.WireModel(GridCellModelBase)
    GridCellRendererBase.OnModelChanged(EventArgs)
    GridCellRendererBase.OnDeactivating()
    GridCellRendererBase.OnDeactived(Int32, Int32)
    GridCellRendererBase.OnBeginEdit()
    GridCellRendererBase.OnEndEdit()
    GridCellRendererBase.QueryFocusInside()
    GridCellRendererBase.OnHasFocusControlChanged()
    GridCellRendererBase.OnSaveChanges()
    GridCellRendererBase.OnRejectChanges()
    GridCellRendererBase.OnStartEditing()
    GridCellRendererBase.OnEditingComplete()
    GridCellRendererBase.OnValidate()
    GridCellRendererBase.OnValidated()
    GridCellRendererBase.OnActivating(Int32, Int32)
    GridCellRendererBase.OnActivated()
    GridCellRendererBase.ShouldDrawEditing(Int32, Int32)
    GridCellRendererBase.ShouldDrawFocused(Int32, Int32)
    GridCellRendererBase.NotifyCurrentCellChanging()
    GridCellRendererBase.NotifyCurrentCellChanged()
    GridCellRendererBase.NotifyCurrentCellControlDoubleClick(Control)
    GridCellRendererBase.ControlDoubleClick(Object, EventArgs)
    GridCellRendererBase.OnControlDoubleClick(Control)
    GridCellRendererBase.NotifyCurrentCellControlGotFocus(Control)
    GridCellRendererBase.NotifyCurrentCellControlLostFocus(Control)
    GridCellRendererBase.OnShowDropDown()
    GridCellRendererBase.OnCloseDropDown(PopupCloseType)
    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.DrawCellAppearance(Graphics, Rectangle, GridStyleInfo)
    GridCellRendererBase.GetMarkHeaderState(Int32, Int32, GridStyleInfo)
    GridCellRendererBase.SetControl(Control)
    GridCellRendererBase.ControlLostFocus(Object, EventArgs)
    GridCellRendererBase.ControlGotFocus(Object, EventArgs)
    GridCellRendererBase.OnSetControlText(String)
    GridCellRendererBase.ResetControlText()
    GridCellRendererBase.UpdateControlValue()
    GridCellRendererBase.SetControlValue(Object, Boolean)
    GridCellRendererBase.InitializeControlText(Object)
    GridCellRendererBase.ResetControlValue()
    GridCellRendererBase.GetDisplayText()
    GridCellRendererBase.GetCellValue()
    GridCellRendererBase.Initialize(Int32, Int32)
    GridCellRendererBase.OnInitialize(Int32, Int32)
    GridCellRendererBase.InitializedAt(Int32, Int32)
    GridCellRendererBase.InitalizedAt(Int32, Int32)
    GridCellRendererBase.Hide()
    GridCellRendererBase.IsControlVisible()
    GridCellRendererBase.RaiseProcessKeyEventArgs(Message)
    GridCellRendererBase.ProcessKeyEventArgs(Message)
    GridCellRendererBase.OnKeyDown(KeyEventArgs)
    GridCellRendererBase.OnKeyUp(KeyEventArgs)
    GridCellRendererBase.OnKeyPress(KeyPressEventArgs)
    GridCellRendererBase.Copy()
    GridCellRendererBase.Paste()
    GridCellRendererBase.Cut()
    GridCellRendererBase.CanPaste()
    GridCellRendererBase.FindText(String, Int32, Int32, GridFindTextOptions, Boolean)
    GridCellRendererBase.GetCellText(GridStyleInfo, GridFindTextOptions)
    GridCellRendererBase.ReplaceText(String, String, Int32, Int32, GridFindTextOptions, Boolean)
    GridCellRendererBase.ReplaceSel(String)
    GridCellRendererBase.GetSelectedText(String)
    GridCellRendererBase.OnNotifyMsg(Message)
    GridCellRendererBase.IsReadOnly()
    GridCellRendererBase.ValidateString(String)
    GridCellRendererBase.RaiseHitTest(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.RaiseMouseHoverLeave(Int32, Int32, EventArgs)
    GridCellRendererBase.RaiseMouseDown(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.ControlMouseDown(Object, MouseEventArgs)
    GridCellRendererBase.RaiseMouseMove(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseMouseUp(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseCancelMode(Int32, Int32)
    GridCellRendererBase.OnCancelMode(Int32, Int32)
    GridCellRendererBase.RaiseClick(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.RaiseDoubleClick(Int32, Int32, MouseEventArgs)
    GridCellRendererBase.OnDoubleClick(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 GridDataBoundRowHeaderCellRenderer : GridHeaderCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
    Remarks

    Defines the renderer part of a row header cell. A renderer is created for each GridCellModelBase and GridControlBase. There can be several renderers associated with one GridDataBoundRowHeaderCellRenderer if several views display the same GridModel.

    The header cell is XP Themes enabled. It will be drawn themed if ThemesEnabled is True.

    The GridDataBoundGrid registers "RowHeaderCell" as identifier in CellType of a cell's GridStyleInfo to associate this cell type with a cell.

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

    PropertyNameDescription
    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)When set to Flat, the header will be drawn with slightly raised edges typical for cell headers. If the grid is XP Themes enabled, the headers will be drawn with XP Themes look. If you specify Sunken or Raised, the header will be drawn with sunken or raised edges and not XP Themed. (Default: GridCellAppearance.Flat)
    CellTipText (System.String)ToolTip text to be displayed when user hovers mouse over cell. (Default: String.Empty)
    CellType (System.String)RowHeaderCell (Default: TextBox)
    Enabled (System.Boolean)Specifies if the cell can be activated as the current cell when the user clicks onto the header. Usually you do not want a header to be activated as the current cell unless you want to have editing capabilities like allowing user to rename header text in place. Such renaming functionality needs to be implemented in a derived class. (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)
    Interior (BrushInfo)Lets you specify a solid back color, gradient, or pattern style with both back and fore color for a cell's background. If the grid is XP Themes enabled, this color will be ignored and the header will be drawn with default XP Themes header background. (Default: SystemColors.Window)
    TextColor (System.Drawing.Color)Lets you specify the color of the arrow, pencil, or star icon. (Default: SystemColors.WindowText)
    TextMargins (GridMarginsInfo)When drawing this header cell this specifies the minimum empty area between the text rectangle without borders and the icon. The icon will be centered inside the remaining rectangle. (Default: GridMarginsInfo.Default)
    Themed (System.Boolean)Specifies if cell should be drawn using Windows XP themes when ThemesEnabled has been set. (Default: True)

    Constructors

    GridDataBoundRowHeaderCellRenderer(GridControlBase, GridCellModelBase)

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

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

    The GridControlBase that displays this cell renderer.

    GridCellModelBase cellModel

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

    Remarks

    References to GridControlBase and GridCellModelBase will be saved.

    Methods

    OnClick(Int32, Int32, MouseEventArgs)

    This is called from GridSelectCellsMouseController 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)

    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

    A reference to the style object of the cell.

    Overrides
    GridHeaderCellRenderer.OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
    Remarks

    When drawing cells, it is necessary to determine if the specified cell (with rowIndex and colIndex) is the current cell and if it is active.

    If your control is associated with a control and supports in-place editing and the specified cell is the current cell, you should position the control. Take a look at the GridTextBoxCellRenderer implementation of this method for an example.

    Otherwise, you can simply draw the cell.

    OnDrawDisplayText(Graphics, Rectangle, Int32, Int32, GridStyleInfo)

    This method is called from OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo) to draw the face text of the header cell after its background has been drawn.

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

    Points to the device context.

    System.Drawing.Rectangle textRectangle

    Specifies the text rectangle. It is the cell rectangle without buttons, borders, or text margins.

    System.Int32 rowIndex

    Specifies the row id.

    System.Int32 colIndex

    Specifies the column id.

    GridStyleInfo style

    A reference to the style object of the cell.

    Overrides
    GridHeaderCellRenderer.OnDrawDisplayText(Graphics, Rectangle, Int32, Int32, GridStyleInfo)

    PaintIcon(Graphics, Rectangle, Point, Bitmap, Color)

    Paint the specified bitmap substituting black pixels with a new color.

    Declaration
    public static Rectangle PaintIcon(Graphics g, Rectangle bounds, Point offset, Bitmap bmp, Color foreColor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    A Graphics object used to draw the bitmap.

    System.Drawing.Rectangle bounds

    A Rectangle which contains the boundary data of the rectangle.

    System.Drawing.Point offset

    A Point that specifies pixels to offset the bitmap from its origin point.

    System.Drawing.Bitmap bmp

    The Bitmap to be drawn on the screen.

    System.Drawing.Color foreColor

    The new color used to substitute black pixels.

    Returns
    Type Description
    System.Drawing.Rectangle

    A Rectangle which contains the boundary data of the drawn bitmap.

    Remarks

    The PaintIcon routine will substitute black pixels of the original bitmap and draw them with the specified fore color. The bitmap is centered inside the specified bounds. Use the offset if you want to display a "pressed button" state. If the button is pressed, specify offset = new Point(1, 1).

    PaintIcon(Graphics, Rectangle, Point, String, Color)

    Load the bitmap from manifest and paint it substituting black pixels with a new color.

    Declaration
    public static void PaintIcon(Graphics g, Rectangle bounds, Point offset, string bitmapName, Color foreColor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    A Graphics object used to draw the bitmap.

    System.Drawing.Rectangle bounds

    A Rectangle which contains the boundary data of the rectangle.

    System.Drawing.Point offset

    A Point that specifies pixels to offset the bitmap from its origin point.

    System.String bitmapName

    The name of the bitmap.

    System.Drawing.Color foreColor

    The new color used to substitute black pixels.

    Remarks

    The PaintIcon routine will substitute black pixels of the original bitmap and draw them with the specified fore color. The bitmap is centered inside the specified bounds. Use the offset if you want to display a "pressed button" state. If the button is pressed, specify offset = new Point(1, 1).

    Implements

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