solved
i'm sure there is an easier and quicker way of adding a new Property varible, but after searching around on google for how to do such things (i've never done it, and don't know where to start) and not finding any answers, and i can't wait here, for an answer, i decided to search around for an alternative answer, and i found one way that works well for my use. this is a broot force method of manually adding a global 'LastFoundRow' variable to the nextgrid v5.5 project.
later versions past v5.5 may already have the LastFoundRow Property in the code/component.
here are the steps to manually adding a global LastFoundRow variable to the nextgrid v5.5 package only. this is assuming that your nextgrid version has the 'nextgrid.findtext()' function, otherwise it won't work.
1. in your main unit1 project, scroll down to the section just past the main interface section and add the following: 'LastFoundRow: integer;' see below.
interface
type
TNotifyEvent = procedure (Sender: TObject) of object;
TForm1 = class(TForm)
.
.
end;
.
.
var
LastFoundRow: integer; // <-- this line is custom added to the unit1, 2014-09-21 sun 05:45pm
Form1: TForm1;
.
.
2. next, locate and open the 'NxCustomGrid.pas' file inside your unit1 project.
3. and enter the unit name from your main project into the uses clause. in my case, it is the default, 'Unit1', under the implementation section, like this:
implementation
uses
unit1, NxColumnClasses, NxScrollControl, NxEdit, DateUtils, Math; // <-- custom added new line, 2014-09-21 sun
4. still in this file, scroll down to the section 'function TNxCustomGrid.Locate' and add the following line: 'LastFoundRow := i;' near the end of that function.
here is the complete updated function:
function TNxCustomGrid.Locate(Index, FromRow, ToRow: Integer; S: WideString;
Options: TSearchOptions): Boolean;
var
i: Integer;
begin
Result := False;
for i := FromRow to ToRow do
begin
if (soSearchInvisible in Options) or GetRowVisible(i) then
begin
if soCaseInsensitive in Options then
begin
if soExactMatch in Options then Result := WideCompareText(Cells[Index, i], S) = 0
else Result := Pos(WideLowerCase(S), WideLowerCase(Cells[Index, i])) > 0;
end else
begin
if soExactMatch in Options then Result := WideCompareStr(Cells[Index, i], S) = 0
else Result := Pos(S, Cells[Index, i]) > 0;
end;
if Result then
begin
SelectedRow := i;
if not IsUpdating then ScrollToRow(i);
Break;
end;
end; { invisible }
end; { for }
LastFoundRow := i; // <-- this line is custom added 2014-09-21 sun 05:45pm
end;
5. recompile all, finish.
here is how to use:
if nextgrid1.FindText(1, 'my text', [soContinueFromTop]) = true then do_something;