Skip to main content
A newer version of this page is available. .

VGridControl() Constructor

Creates a new VGridControl object with default settings.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v19.2.dll

Declaration

public VGridControl()

Remarks

Use the constructor to create a new vertical grid control at runtime. Note that the created control’s Parent property must be set to a form or another control that will contain the vertical grid. Otherwise, the created control will not be displayed.

Example

The sample code below shows you how to:

  • create a new vertical grid control;
  • bind the control to data (the dynamically created dataset is assigned to the VGridControl.DataSource property for this purpose);
  • show the control on a form, filling the entire form with it (the form is assigned to the Parent property of the control).

The result of executing the sample code is shown in the image below:

VGrid - CreatingNew

using DevExpress.XtraVerticalGrid;

private void Form1_Load(object sender, System.EventArgs e) {
   // creating a new vertical grid control
   VGridControl vGrid1 = new VGridControl();
   this.Controls.Add(vGrid1);
   vGrid1.Dock = DockStyle.Fill;
   // creating the data source for the grid
   DataSet gridSource = new DataSet();
   gridSource.ReadXml("E:\\DBs\\cars.xml");
   // binding the grid to the data source and creating rows for all fields
   vGrid1.DataSource = gridSource.Tables["Cars"];
   vGrid1.RetrieveFields();
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the VGridControl() 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.

See Also