Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxGridViewRepository.CreateItem(TcxCustomGridViewClass) Method

Creates a new View of a specific class and adds it to the View repository.

#Declaration

Delphi
function CreateItem(AItemClass: TcxCustomGridViewClass): TcxCustomGridView;

#Parameters

Name Type
AItemClass TcxCustomGridViewClass

#Returns

Type
TcxCustomGridView

#Remarks

You can use the CreateItem function to add a new View to the View repository. The class of the View is determined by the AItemClass parameter. The Editor of the View repository allows you to create a View of the required type at design-time. To open it, double-click the View repository icon or select the Editor… option from its context menu.

To delete a specific View from the View repository, call its destructor.

The following code adds a new TcxGridDBTableView to the View repository:

var
  AView: TcxGridDBTableView;
//...
  AView := TcxGridDBTableView
    (cxGridViewRepository1.CreateItem(TcxGridDBTableView));
  with AView do
  begin
    DataController.DataSource := DataSource1;
    DataController.CreateAllItems;
    //...
  end;
See Also