Skip to main content

TcxGridLevel.OnGetGridView Event

Enables you to substitute the View that will display detail data.

Declaration

property OnGetGridView: TcxGridLevelGetGridViewEvent read; write;

Remarks

Detail levels raise the OnGetGridView event when a row within the master level is expanded. This event allows you to change the View that will display detail data corresponding to the master row being expanded. Thus, you can provide different Views for details corresponding to different master rows.

The Sender parameter represents the detail level whose corresponding View can be changed.

The AMasterRecord parameter is the master record being expanded.

If you need to change the View that will represent detail data for that master record, assign the desired View to the AGridView parameter. You have the following options to create and customize Views before passing them as this parameter:

  • Create Views within the grid control but do not associate them with grid levels. In this instance, the grid control manages all the changes you apply to these Views and automatically propagates them to clone Views;

  • Create standalone Views using the TcxGridViewRepository component. If you apply changes to these Views after clone Views are created, you need to either manually clear the clone Views or re-create them as described below.

Note

The OnGetGridView event is raised only once when the detail is first expanded. After the event handler has been executed, the specified View’s clone is created and cached so that the event doesn’t fire when expanding the same master record next times. If you need the event to be raised later, you can clear all detail clones by calling the master data controller’s ClearDetails method. If you need to recreate a particular detail clone, use the master data controller’s ClearDetailLinkObject method.

See Also