Developer

QueryCells

Returns TNxCells6 object based on result of specified query.

function QueryCells(Query: WideString): TNxCells6;

Remarks:


Grid's main Cells object remain intact, but new TNxCells6 object (referencing same Grid) is created. TNxCell6 object may be assigned to target Grid via CellSource property of TNextGrid6.

Query examples:

colSalary >= 10000 or colSalary <= 20000 colFirstName = "Ann" and colActive = False
Example:

procedure TForm3.Button1Click(Sender: TObject); const s = 'colSalary > 20000 and colActive = True'; var Cells: TNxCells6; begin // Query first Grid Cells := NextGrid61.QueryCells(s); // Fill second Grid with result NextGrid62.CellSource := Cells; end;
TNxCells6 object may be read by using its methods such as Cell[ACol, ARow], Row[Index], RowCount etc.

if Cells.RowCount = 1 then begin MyVar := Cells.Cell[0, 0].AsFloat; end;

See also