Back to Devexpress

GridControl.Dock Property

windowsforms-devexpress-dot-xtragrid-dot-gridcontrol-d50c463c.md

latest5.4 KB
Original Source

GridControl.Dock Property

Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.

Namespace : DevExpress.XtraGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
public override DockStyle Dock { get; set; }
vb
Public Overrides Property Dock As DockStyle

Property Value

TypeDescription
DockStyle

A DockStyle value.

|

Remarks

In Split Presentation mode, a GridControl is placed within a GridSplitContainer, by occupying its entire region. The Dock property is set to Fill and cannot be changed in this mode.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Dock property.

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-display-icons-in-data-cells/CS/Form1.cs#L75

csharp
//
this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControl1.Location = new System.Drawing.Point(0, 0);

winforms-grid-draw-thick-border-abound-focused-cell/CS/Form1.cs#L68

csharp
//
this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControl1.EmbeddedNavigator.Name = "";

winforms-grid-create-configure-sql-data-source/CS/dxSample/Form1.cs#L37

csharp
_Grid.MainView = view;
_Grid.Dock = DockStyle.Fill;
Controls.Add(_Grid);

winforms-grid-use-layoutview-as-master-view/CS/WindowsApplication3/MasterDetailHelper.cs#L68

csharp
GridControl grid = new GridControl();
grid.Dock = System.Windows.Forms.DockStyle.Fill;
return grid;

winforms-pivotgrid-how-to-display-underlying-data/CS/DrillDownDataSourceExample/Form1.cs#L46

csharp
grid.Parent = form;
grid.Dock = DockStyle.Fill;
grid.DataSource = dataSource;

winforms-grid-display-icons-in-data-cells/VB/Form1.vb#L69

vb
'
gridControl1.Dock = DockStyle.Fill
gridControl1.Location = New System.Drawing.Point(0, 0)

winforms-grid-draw-thick-border-abound-focused-cell/VB/Form1.vb#L69

vb
'
Me.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.gridControl1.EmbeddedNavigator.Name = ""

winforms-grid-create-configure-sql-data-source/VB/dxSample/Form1.vb#L44

vb
_Grid.MainView = view
_Grid.Dock = DockStyle.Fill
Controls.Add(_Grid)

winforms-grid-use-layoutview-as-master-view/VB/WindowsApplication3/MasterDetailHelper.vb#L78

vb
Dim grid As New GridControl()
grid.Dock = System.Windows.Forms.DockStyle.Fill
Return grid

winforms-pivotgrid-how-to-display-underlying-data/VB/DrillDownDataSourceExample/Form1.vb#L44

vb
grid.Parent = form
grid.Dock = DockStyle.Fill
grid.DataSource = dataSource

See Also

GridControl Class

GridControl Members

DevExpress.XtraGrid Namespace