Mirror

How to display the value of a field in the hint of a TDBGrid (Views: 39)


Problem/Question/Abstract:

Does someone have a code snippet showing how I can display a field value from the TDBGrid row where the mouse pointer has stayed long enough to invoke the hint?

Answer:

This is the way I would do it:

{ ... }
if not VarIsNull(table1['PARTNO']) then
  dbGrid1.hint := table1['PARTNO'];

I found that you have to check to see if there is data in the field before you use it, also you would need to convert to a string inttostr(table1['PARTNO']) if needed.

<< Back to main page