Hint for each row in dbgrid.. not for dbgrid itself

Posted on 2007-07-24
Last Modified: 2013-11-23

i have a dbgrid showing data from database, i see that hint property is general, i want a method doing showing hint from database and according to the current record.

is that allowed?  and how?
Question by:speedbit
    LVL 19

    Expert Comment

    Capture the OnMouseMove event of the grid.
    Figure out what record you're hovering on and set the controls general hint to the text you want for that record.

    Author Comment

    thank you but would u type the code please ?
    LVL 19

    Accepted Solution

    try this:

    procedure TForm11.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    var GridCoord: TGridCoord;
     GridCoord := DBGrid1.MouseCoord(X, Y);
     DBGrid1.Hint := IntToStr(GridCoord.X) + ' - ' + IntToStr(GridCoord.Y);

    Make sure the ShowHint property of the DBGrid is set to true.
    You'll have to set the proper text of the hint yourself.
    LVL 19

    Expert Comment

    maybe this is even a better solution:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now