Back to Devexpress

GridView(GridControl) Constructor

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-dot-ctor-x28-devexpress-dot-xtragrid-dot-gridcontrol-x29.md

latest4.9 KB
Original Source

GridView(GridControl) Constructor

Creates a new GridView object with the specified owner control.

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public GridView(
    GridControl ownerGrid
)
vb
Public Sub New(
    ownerGrid As GridControl
)

Parameters

NameTypeDescription
ownerGridGridControl

A GridControl object representing the grid control that will own the new View. This value is assigned to the BaseView.GridControl property.

|

Remarks

You can use the created View in a number of ways. For instance, assign it to the grid’s GridControl.MainView property, add it to the GridControl.LevelTree tree or use it within the master-detail events provided by the XtraGrid.

Before using a View within the Grid Control ensure that its BaseView.GridControl property has been initialized. For Views created at design time this property is initialized automatically. If a View is assigned to the GridControl.MainView property its BaseView.GridControl property is also initialized automatically. In all other cases the BaseView.GridControl property should be set manually.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GridView(GridControl) constructor.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-introduce-custom-options-in-auto-filter-row/VB/WindowsApplication3/CustomGrid.vb#L42

vb
Public Sub New(ByVal grid As DevExpress.XtraGrid.GridControl)
    MyBase.New(grid)
End Sub

winforms-grid-implement-serializable-column-property/VB/Q242361/Grid.vb#L32

vb
Public Sub New(ByVal grid As GridControl)
    MyBase.New(grid)
End Sub

winforms-grid-create-gridview-descendant/VB/MyXtraGrid/MyGridView.vb#L11

vb
Public Sub New(ByVal grid As DevExpress.XtraGrid.GridControl)
    MyBase.New(grid)
    ' put your initialization code here

winforms-grid-print-custom-draw-content/VB/MyXtraGrid/MyGridView/MyGridView.vb#L19

vb
Public Sub New(ByVal grid As DevExpress.XtraGrid.GridControl)
    MyBase.New(grid)
    ' put your initialization code here

winforms-grid-custom-draw-grid-lines/VB/WindowsApplication3/MyGridView.vb#L13

vb
Public Sub New(ByVal grid As DevExpress.XtraGrid.GridControl)
    MyBase.New(grid)
    ' put your initialization code here

See Also

MainView

GridView Class

GridView Members

DevExpress.XtraGrid.Views.Grid Namespace