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

Example: TcxDBDataModeController.OnDetailIsCurrentQuery

The implementation of the TcxDBDataModeController.OnDetailIsCurrentQuery event is demonstrated in this example. In this event True is returned if the corresponding parameterized query should not be reopened. If the query should be reopened, False is returned.

If the query defines the required data (the query parameter specifies the same value as a detail key field value), it is not reopened.

function TForm1.DBTableView1DataControllerDataModeControllerDetailIsCurrentQuery(
  Sender: TcxDBDataModeController; ADataSet: TDataSet;
  const AMasterDetailKeyFieldNames: string;
  const AMasterDetailKeyValues: Variant): Boolean;
begin
  with (ADataSet as TQuery) do
    Result := ParamByName('CustNo').Value = AMasterDetailKeyValues;
end;