Setting focus to a row in a string grid

Posted on 2003-02-27
Medium Priority
Last Modified: 2010-05-18
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
                if pos(AnsiUpperCase(frmFind.txtFind.Text),AnsiUpperCase(grdComplete.Cols[0].Strings[i])) > 0 then

                        //move to row????


Question by:cpk68
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Alphomega earned 160 total points
ID: 8033001
StringGrid1.Col := yourcol;
 StringGrid1.Row := yourrow;

Author Comment

ID: 8033021
Thanks, so obvious.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question