Search Results for

    Show / Hide Table of Contents

    Class GridControl

    Displays data in a customizable grid. Wraps the System.Windows.Forms.DataGridView control.

    Inheritance
    System.Object
    Base
    ComponentBase
    DialogComponentBase
    DialogControl
    GridControl
    Implements
    IFRSerializable
    IHasEditor
    IParent
    Inherited Members
    DialogControl.ShouldSerializeBackColor()
    DialogControl.ShouldSerializeCursor()
    DialogControl.ShouldSerializeFont()
    DialogControl.ShouldSerializeForeColor()
    DialogControl.GetSelectionPoints()
    DialogControl.DrawSelectionPoint(Graphics, Pen, Brush, Single, Single)
    DialogControl.CheckParent(Boolean)
    DialogControl.DrawSelection(FRPaintEventArgs)
    DialogControl.Draw(FRPaintEventArgs)
    DialogControl.InvokeEditor()
    DialogControl.OnBeforeInsert(Int32)
    DialogControl.Click
    DialogControl.DoubleClick
    DialogControl.Enter
    DialogControl.Leave
    DialogControl.KeyDown
    DialogControl.KeyPress
    DialogControl.KeyUp
    DialogControl.MouseDown
    DialogControl.MouseMove
    DialogControl.MouseUp
    DialogControl.MouseEnter
    DialogControl.MouseLeave
    DialogControl.Resize
    DialogControl.TextChanged
    DialogControl.Paint
    DialogControl.Control
    DialogControl.Cursor
    DialogControl.Enabled
    DialogControl.Font
    DialogControl.RightToLeft
    DialogControl.TabIndex
    DialogControl.TabStop
    DialogControl.Dock
    DialogControl.Anchor
    DialogControl.Visible
    DialogControl.BindableProperty
    DialogControl.ClickEvent
    DialogControl.DoubleClickEvent
    DialogControl.EnterEvent
    DialogControl.LeaveEvent
    DialogControl.KeyDownEvent
    DialogControl.KeyPressEvent
    DialogControl.KeyUpEvent
    DialogControl.MouseDownEvent
    DialogControl.MouseMoveEvent
    DialogControl.MouseUpEvent
    DialogControl.MouseEnterEvent
    DialogControl.MouseLeaveEvent
    DialogControl.ResizeEvent
    DialogControl.TextChangedEvent
    DialogControl.PaintEvent
    DialogControl.Left
    DialogControl.Top
    DialogControl.Width
    DialogControl.Height
    DialogControl.Dispose(Boolean)
    DialogControl.OnEnabledChanged()
    DialogControl.AttachEvents()
    DialogControl.DetachEvents()
    DialogControl.SetParent(Base)
    DialogControl.Focus()
    DialogControl.Hide()
    DialogControl.Show()
    DialogControl.OnClick(EventArgs)
    DialogControl.OnDoubleClick(EventArgs)
    DialogControl.OnEnter(EventArgs)
    DialogControl.OnLeave(EventArgs)
    DialogControl.OnKeyDown(KeyEventArgs)
    DialogControl.OnKeyPress(KeyPressEventArgs)
    DialogControl.OnKeyUp(KeyEventArgs)
    DialogControl.OnMouseDown(MouseEventArgs)
    DialogControl.OnMouseMove(MouseEventArgs)
    DialogControl.OnMouseUp(MouseEventArgs)
    DialogControl.OnMouseEnter(EventArgs)
    DialogControl.OnMouseLeave(EventArgs)
    DialogControl.OnResize(EventArgs)
    DialogControl.OnTextChanged(EventArgs)
    DialogControl.OnPaint(PaintEventArgs)
    DialogComponentBase.Location
    DialogComponentBase.Size
    DialogComponentBase.Assign(Base)
    ComponentBase.AbsBottom
    ComponentBase.AbsBounds
    ComponentBase.AbsLeft
    ComponentBase.AbsRight
    ComponentBase.AbsTop
    ComponentBase.Bottom
    ComponentBase.Bounds
    ComponentBase.ClientSize
    ComponentBase.GroupIndex
    ComponentBase.Right
    ComponentBase.Tag
    ComponentBase.VisibleExpression
    ComponentBase.Printable
    ComponentBase.PrintableExpression
    ComponentBase.GetExpressions()
    ComponentBase.CalcVisibleExpression(String)
    FastReport.ComponentBase.CheckNegativeSize(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.DrawDragAcceptFrame(FastReport.Utils.FRPaintEventArgs, System.Drawing.Color)
    FastReport.ComponentBase.GetPreferredSize()
    FastReport.ComponentBase.GetSmartTag()
    FastReport.ComponentBase.HandleDoubleClick()
    FastReport.ComponentBase.HandleDragDrop(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleDragOver(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleKeyDown(System.Windows.Forms.Control, System.Windows.Forms.KeyEventArgs)
    FastReport.ComponentBase.HandleMouseDown(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleMouseHover(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleMouseMove(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleMouseUp(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleMouseWheel(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.PointInObject(System.Drawing.PointF)
    FastReport.ComponentBase.DrawSelectionPoint(FastReport.Utils.FRPaintEventArgs, System.Drawing.Pen, System.Drawing.Brush, System.Single, System.Single)
    FastReport.ComponentBase.PointInSelectionPoint(System.Single, System.Single, System.Drawing.PointF)
    Base.Name
    Base.Restrictions
    Base.Flags
    Base.Parent
    Base.BaseName
    Base.ClassName
    Base.Report
    Base.Page
    Base.ChildObjects
    Base.AllObjects
    Base.ZOrder
    Base.IsAncestor
    Base.IsDesigning
    Base.IsPrinting
    Base.IsRunning
    Base.OriginalComponent
    Base.Disposed
    Base.SetProp(Base, Base)
    Base.FloatDiff(Single, Single)
    Base.ExtractDefaultMacros(String)
    Base.Dispose()
    Base.SetFlags(Flags, Boolean)
    Base.SetReport(Report)
    Base.SetName(String)
    Base.SetParentCore(Base)
    Base.FindObject(String)
    Base.CreateUniqueName()
    Base.Deserialize(FRReader)
    Base.BaseAssign(Base)
    Base.AssignAll(Base)
    Base.HasParent(Base)
    Base.HasFlag(Flags)
    Base.HasRestriction(Restrictions)
    Base.InvokeEvent(String, Object)
    Base.OnAfterLoad()
    Base.GetCustomScript()
    Base.ExtractMacros()
    Base.IsHaveToConvert(Object)
    Base.GetConvertedObjects()
    Base.ForEachAllConvectedObjects(Object)
    FastReport.Base.IsSelected
    FastReport.Base.IsParentSelected
    FastReport.Base.Delete()
    FastReport.Base.OnAfterInsert(FastReport.InsertFrom)
    FastReport.Base.SelectionChanged()
    FastReport.Base.GetImageIndex()
    Namespace: FastReport.Dialog
    Assembly: FastReport.dll
    Syntax
    public class GridControl : DialogControl, IDisposable, IFRSerializable, IHasEditor, IParent

    Constructors

    GridControl()

    Initializes a new instance of the GridControl class with default settings.

    Declaration
    public GridControl()

    Properties

    AllowUserToAddRows

    Gets or sets a value indicating whether the option to add rows is displayed to the user. Wraps the System.Windows.Forms.DataGridView.AllowUserToAddRows property.

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

    AllowUserToDeleteRows

    Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView. Wraps the System.Windows.Forms.DataGridView.AllowUserToDeleteRows property.

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

    AlternatingRowsDefaultCellStyle

    Gets or sets the default cell style applied to odd-numbered rows of the DataGridView. Wraps the System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle property.

    Declaration
    public DataGridViewCellStyle AlternatingRowsDefaultCellStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewCellStyle

    AutoSizeColumnsMode

    Gets or sets a value indicating how column widths are determined. Wraps the System.Windows.Forms.DataGridView.AutoSizeColumnsMode property.

    Declaration
    public DataGridViewAutoSizeColumnsMode AutoSizeColumnsMode { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewAutoSizeColumnsMode

    AutoSizeRowsMode

    Gets or sets a value indicating how row heights are determined. Wraps the System.Windows.Forms.DataGridView.AutoSizeRowsMode property.

    Declaration
    public DataGridViewAutoSizeRowsMode AutoSizeRowsMode { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewAutoSizeRowsMode

    BackColor

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public override Color BackColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color
    Overrides
    DialogControl.BackColor

    BackgroundColor

    Gets or sets the background color of the DataGridView. Wraps the System.Windows.Forms.DataGridView.BackgroundColor property.

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

    BorderStyle

    Gets or sets the border style for the DataGridView. Wraps the System.Windows.Forms.DataGridView.BorderStyle property.

    Declaration
    public BorderStyle BorderStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.BorderStyle

    CellBorderStyle

    Gets the cell border style for the DataGridView. Wraps the System.Windows.Forms.DataGridView.CellBorderStyle property.

    Declaration
    public DataGridViewCellBorderStyle CellBorderStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewCellBorderStyle

    ColumnHeadersBorderStyle

    Gets the border style applied to the column headers. Wraps the System.Windows.Forms.DataGridView.ColumnHeadersBorderStyle property.

    Declaration
    public DataGridViewHeaderBorderStyle ColumnHeadersBorderStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewHeaderBorderStyle

    ColumnHeadersDefaultCellStyle

    Gets or sets the default column header style. Wraps the System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle property.

    Declaration
    public DataGridViewCellStyle ColumnHeadersDefaultCellStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewCellStyle

    ColumnHeadersHeight

    Gets or sets the height, in pixels, of the column headers row. Wraps the System.Windows.Forms.DataGridView.ColumnHeadersHeight property.

    Declaration
    public int ColumnHeadersHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    ColumnHeadersHeightSizeMode

    Gets or sets a value indicating whether the height of the column headers is adjustable and whether it can be adjusted by the user or is automatically adjusted to fit the contents of the headers. Wraps the System.Windows.Forms.DataGridView.ColumnHeadersHeightSizeMode property.

    Declaration
    public DataGridViewColumnHeadersHeightSizeMode ColumnHeadersHeightSizeMode { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode

    ColumnHeadersVisible

    Gets or sets a value indicating whether the column header row is displayed. Wraps the System.Windows.Forms.DataGridView.ColumnHeadersVisible property.

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

    Columns

    Gets the collection of GridControlColumn objects that represents the grid columns.

    Declaration
    public GridControlColumnCollection Columns { get; }
    Property Value
    Type Description
    GridControlColumnCollection

    DataGridView

    Gets an internal DataGridView.

    Declaration
    [Browsable(false)]
    public DataGridView DataGridView { get; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridView

    DataSource

    Gets or sets the data source that the DataGridView is displaying data for.

    Declaration
    public DataSourceBase DataSource { get; set; }
    Property Value
    Type Description
    DataSourceBase

    DefaultCellStyle

    Gets or sets the default cell style to be applied to the cells in the DataGridView if no other cell style properties are set. Wraps the System.Windows.Forms.DataGridView.DefaultCellStyle property.

    Declaration
    public DataGridViewCellStyle DefaultCellStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewCellStyle

    ForeColor

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public override Color ForeColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color
    Overrides
    DialogControl.ForeColor

    GridColor

    Gets or sets the color of the grid lines separating the cells of the DataGridView. Wraps the System.Windows.Forms.DataGridView.GridColor property.

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

    MultiSelect

    Gets or sets a value indicating whether the user is allowed to select more than one cell, row, or column of the DataGridView at a time. Wraps the System.Windows.Forms.DataGridView.MultiSelect property.

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

    ReadOnly

    Gets a value indicating whether the user can edit the cells of the DataGridView control. Wraps the System.Windows.Forms.DataGridView.ReadOnly property.

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

    RowHeadersBorderStyle

    Gets or sets the border style of the row header cells. Wraps the System.Windows.Forms.DataGridView.RowHeadersBorderStyle property.

    Declaration
    public DataGridViewHeaderBorderStyle RowHeadersBorderStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewHeaderBorderStyle

    RowHeadersDefaultCellStyle

    Gets or sets the default style applied to the row header cells. Wraps the System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle property.

    Declaration
    public DataGridViewCellStyle RowHeadersDefaultCellStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewCellStyle

    RowHeadersVisible

    Gets or sets a value indicating whether the column that contains row headers is displayed. Wraps the System.Windows.Forms.DataGridView.RowHeadersVisible property.

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

    RowHeadersWidth

    Gets or sets the width, in pixels, of the column that contains the row headers. Wraps the System.Windows.Forms.DataGridView.RowHeadersWidth property.

    Declaration
    public int RowHeadersWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    RowHeadersWidthSizeMode

    Gets or sets a value indicating whether the width of the row headers is adjustable and whether it can be adjusted by the user or is automatically adjusted to fit the contents of the headers. Wraps the System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode property.

    Declaration
    public DataGridViewRowHeadersWidthSizeMode RowHeadersWidthSizeMode { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode

    RowsDefaultCellStyle

    Gets or sets the default style applied to the row cells of the DataGridView. Wraps the System.Windows.Forms.DataGridView.RowsDefaultCellStyle property.

    Declaration
    public DataGridViewCellStyle RowsDefaultCellStyle { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewCellStyle

    ScrollBars

    Gets or sets the type of scroll bars to display for the DataGridView control. Wraps the System.Windows.Forms.DataGridView.ScrollBars property.

    Declaration
    public ScrollBars ScrollBars { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.ScrollBars

    SelectionMode

    Gets or sets a value indicating how the cells of the DataGridView can be selected. Wraps the System.Windows.Forms.DataGridView.SelectionMode property.

    Declaration
    public DataGridViewSelectionMode SelectionMode { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.DataGridViewSelectionMode

    Text

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public override string Text { get; set; }
    Property Value
    Type Description
    System.String
    Overrides
    DialogControl.Text

    Methods

    AddChild(Base)

    Adds a child object to this object's childs.

    Declaration
    public void AddChild(Base child)
    Parameters
    Type Name Description
    Base child

    Object to add.

    CanContain(Base)

    Gets a value indicating that this object can contain the specified child object.

    Declaration
    public bool CanContain(Base child)
    Parameters
    Type Name Description
    Base child

    Child object.

    Returns
    Type Description
    System.Boolean

    true if this object can contain the specified child object; otherwise, false.

    Clear()

    Clears the object's state.

    Declaration
    public override void Clear()
    Overrides
    Base.Clear()
    Remarks

    This method also disposes all object's children.

    DeserializeSubItems(FRReader)

    Deserializes nested object properties.

    Declaration
    protected override void DeserializeSubItems(FRReader reader)
    Parameters
    Type Name Description
    FRReader reader

    Reader object.

    Overrides
    Base.DeserializeSubItems(FRReader)
    Remarks

    Typically the object serializes all properties to the single xml item:

    <TextObject Name="Text2" Left="18.9" Top="37.8" Width="283.5" Height="28.35"/>

    Some objects like DataBand have child objects that serialized in subitems:

    <DataBand Name="Data1" Top="163" Width="718.2" Height="18.9">
      <TextObject Name="Text3" Left="18.9" Top="37.8" Width="283.5" Height="28.35"/>
    </DataBand>

    To read such subitems, the DeserializeSubItems method is used. Base implementation reads the child objects. You may override it to read some specific subitems.

    FinalizeControl()

    Finalizes the control after its parent form is closed.

    Declaration
    public override void FinalizeControl()
    Overrides
    DialogControl.FinalizeControl()
    Remarks

    This method is called when report is run.

    GetChildObjects(ObjectCollection)

    Gets a list of child objects.

    Declaration
    public void GetChildObjects(ObjectCollection list)
    Parameters
    Type Name Description
    ObjectCollection list

    List to fill with values.

    GetChildOrder(Base)

    Returns z-order of the specified child object.

    Declaration
    public int GetChildOrder(Base child)
    Parameters
    Type Name Description
    Base child

    Child object.

    Returns
    Type Description
    System.Int32

    Z-order of the specified object.

    Remarks

    This method must return the index of a specified child object in the internal child list.

    GetContextMenu()

    Gets the object's context menu.

    Declaration
    public override ContextMenuBase GetContextMenu()
    Returns
    Type Description
    ContextMenuBase

    Null reference if object does not have a menu.

    Overrides
    DialogComponentBase.GetContextMenu()
    Remarks

    Do not call this method directly. You may override it if you are developing a new component for FastReport.

    You may use base menu classes such as ComponentBaseMenu, ReportComponentBaseMenu to create own context menus.

    InitializeControl()

    Initializes the control before display it in the dialog form.

    Declaration
    public override void InitializeControl()
    Overrides
    DialogControl.InitializeControl()
    Remarks

    This method is called when report is run.

    RemoveChild(Base)

    Removes a specified object from this object's childs.

    Declaration
    public void RemoveChild(Base child)
    Parameters
    Type Name Description
    Base child

    Serialize(FRWriter)

    Serializes the object.

    Declaration
    public override void Serialize(FRWriter writer)
    Parameters
    Type Name Description
    FRWriter writer

    Writer object.

    Overrides
    DialogControl.Serialize(FRWriter)
    Remarks

    Do not call this method directly. You should override it if you are developing a new component for FastReport.

    This method is called when the object needs to save the state. It may happen when:

    • saving the report to the file or stream;
    • saving the report to the designer's undo buffer;
    • assigning the object to another object using the Assign(Base) or AssignAll methods;
    • saving the object to the designer's clipboard;
    • saving the object to the preview (when run a report).

    SetChildOrder(Base, Int32)

    Sets the z-order of the specified object.

    Declaration
    public void SetChildOrder(Base child, int order)
    Parameters
    Type Name Description
    Base child

    Child object.

    System.Int32 order

    New Z-order.

    Remarks

    This method must place the specified child object at the specified position in the internal child list.

    UpdateLayout(Single, Single)

    Updates the children layout when the size of this object is changed by dx, dy values.

    Declaration
    public void UpdateLayout(float dx, float dy)
    Parameters
    Type Name Description
    System.Single dx

    X delta.

    System.Single dy

    Y delta.

    Remarks

    This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.

    Implements

    IFRSerializable
    IHasEditor
    IParent
    Back to top © 1998-2025 Copyright Fast Reports Inc.