It would be usefull if there was a SearchFirst function to find the first record that matched the search criteria based on the current sort order. SearcNext starts searching from the selected row, so the next record that matches the search criteria is not neccessarily the first record that matches the search criteria.
Instead of adding a SearchFirst (FindFirst?) function, you can achieve the same result by passing a "FromFirst" parameter to the SearchNext function.
CODE
function TNxCustomGrid.SearchNext(ColumnIndex: Integer; Value: WideString; FromFirst: Boolean = False): Boolean;
..........
begin
Result := False;
if RowCount = 0 then Exit;
//start new
if FromFirst then
Result := Roll(0, RowCount - 1)
else
//end new
Result := Roll(SelectedRow + 1, RowCount - 1) or Roll(0, SelectedRow);
end;
..........
begin
Result := False;
if RowCount = 0 then Exit;
//start new
if FromFirst then
Result := Roll(0, RowCount - 1)
else
//end new
Result := Roll(SelectedRow + 1, RowCount - 1) or Roll(0, SelectedRow);
end;
Regards,
Deon