TcxGridViewRepository.CreateItem(TcxCustomGridViewClass) Method
In This Article
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 |
---|---|
AItem |
Tcx |
#Returns
Type |
---|
Tcx |
#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