Skip to main content

GridControl.CreateView(String) Method

Creates a View of the specified type.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.1.dll

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

Declaration

public virtual BaseView CreateView(
    string name
)

Parameters

Name Type Description
name String

A String that specifies the View type.

Returns

Type Description
BaseView

A BaseView descendant representing the new View.

Remarks

The name parameter defines the View type registered in the GridControl.AvailableViews collection. To create a CardView object, pass the ‘CardView‘ string. The ‘GridView‘, ‘BandedGridView‘ and ‘AdvBandedGridView‘ strings allow you to create GridView, BandedGridView and AdvBandedGridView Views respectively.

Note that you can also create Views using their constructors.

After the View has been created, you can either assign it to the GridControl.MainView property or add it to the GridControl.LevelTree tree.

See Also