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

GridControl.CreateView(String) Method

Creates a View of the specified type.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v17.2.dll

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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateView(String) method.

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