Skip to main content

TcxGridViewRepository.CreateItem(TcxCustomGridViewClass) Method

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

Declaration

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