Setting focus to a row in a string grid

Hello all,

I'm new to delphi, so still trying to find my way around.

I have a string grid populated with various things. I want to search the strings for something and then set focus to that row. the searching is fine, but how do I set focus to the row? (Is there a simpler way to do it?)

Below is the code:

        for i := 0 to grdComplete.Cols[0].Count - 1 DO
        begin
                if pos(AnsiUpperCase(frmFind.txtFind.Text),AnsiUpperCase(grdComplete.Cols[0].Strings[i])) > 0 then
                begin

                        //move to row????
                        exit;
                end;

        end;


Thanks
Charel
cpk68Asked:
Who is Participating?
 
AlphomegaConnect With a Mentor Commented:
StringGrid1.Col := yourcol;
 StringGrid1.Row := yourrow;
0
 
cpk68Author Commented:
Thanks, so obvious.
0
All Courses

From novice to tech pro — start learning today.