Skip to main content

Example: TcxCustomDataController.BeginLocate, TcxCustomDataController.EndLocate

The following code searches the record containing a specific value of the EmpNo field in the dataset displayed by a tvEmployee view of ExpressQuantumGrid. The TDataSet.Locate method used for searching is enclosed by the BeginLocate and EndLocate methods. It prevents the data controller from the full data reloading which usually occurs when using Locate.

AValue: Integer;
//...
  AValue := 71;
  with tvEmployee.DataController do
  begin
    BeginLocate;
    try
      DataSet.Locate('EmpNo', AValue, []);
    finally
      EndLocate;
    end;
  end;