Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
TDBGrid.OnGetCellHint determine cell
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
[SOLVED] Assembler error ...
by
Thausand
[
Today
at 01:25:35 am]
CudaText editor (written ...
by
szlbz
[January 14, 2026, 11:36:38 pm]
Embedded qss stylesheets ...
by
jns
[January 14, 2026, 11:27:39 pm]
Maze Makers: Now looking ...
by
speter
[January 14, 2026, 10:43:06 pm]
New book on Object Pascal
by
BodgerBen
[January 14, 2026, 10:32:05 pm]
Dice (raylib + kraft phys...
by
Guva
[January 14, 2026, 06:11:51 pm]
TSpeedButton qt6 styleshe...
by
big_M
[January 14, 2026, 04:53:29 pm]
How to prevent onDropFile...
by
Hansaplast
[January 14, 2026, 04:51:23 pm]
The compiler fails to war...
by
Martin_fr
[January 14, 2026, 03:53:06 pm]
Linked List Using Two Cla...
by
Thaddy
[January 14, 2026, 03:39:08 pm]
Lazarus seems to be makin...
by
Nicole
[January 14, 2026, 03:28:35 pm]
unit init, finalize and i...
by
Zvoni
[January 14, 2026, 02:48:57 pm]
Lazreport PDF
by
mig-31
[January 14, 2026, 11:54:11 am]
Locate current record aft...
by
Zvoni
[January 14, 2026, 09:59:08 am]
Drag and Drop Files; onDr...
by
Hansaplast
[January 14, 2026, 09:39:25 am]
Lazarus and Libre Office
by
MarkMLl
[January 14, 2026, 09:22:14 am]
scat bikes (inc)
by
speter
[January 14, 2026, 04:38:11 am]
Effect of adding properti...
by
n7800
[January 14, 2026, 04:13:36 am]
solution for installing F...
by
BradleySlavik
[January 14, 2026, 02:37:22 am]
What was your first compu...
by
CM630
[January 13, 2026, 10:09:19 pm]
Dragging files to .app no...
by
Boleeman
[January 13, 2026, 10:06:09 pm]
PngDrop: Reduce the size ...
by
Boleeman
[January 13, 2026, 09:50:19 pm]
Fantasy Worldbuilder; Pro...
by
Boleeman
[January 13, 2026, 09:45:56 pm]
StrToDateTime problems
by
Nicole
[January 13, 2026, 07:45:13 pm]
How to forward a Class in...
by
Hartmut
[January 13, 2026, 07:41:31 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TDBGrid.OnGetCellHint determine cell (Read 1796 times)
LemonParty
Sr. Member
Posts: 393
TDBGrid.OnGetCellHint determine cell
«
on:
August 19, 2025, 09:17:43 pm »
I have a TDBGrid and I want to show a specific hint for different rows. How to determine for which row hint was called?
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Bart
Hero Member
Posts: 5663
Re: TDBGrid.OnGetCellHint determine cell
«
Reply #1 on:
August 19, 2025, 10:18:41 pm »
OK, the signature of OnGetCellHit for DBGrid is not the same as for TStringGrid.
Maybe you can use MouseToCell() to determine the cell?
Bart
Logged
wp
Hero Member
Posts: 13328
Re: TDBGrid.OnGetCellHint determine cell
«
Reply #2 on:
August 19, 2025, 10:56:40 pm »
When you want to display an individual hint for specific cells you must store these hints somewhere. I think the most natural way for a database application is to provide a separate field for the hint text. In this case you can simply read the field value and assign it to the Text output parameter of the OnGetCellHint event.
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
DBGrid1GetCellHint
(
Sender
:
TObject
;
Column
:
TColumn
;
var
AText
:
String
)
;
begin
case
Column
.
Field
.
FieldName
of
'ID'
:
AText
:
=
MemDataset1
.
FieldByName
(
'Hint_ID'
)
.
AsString
;
'Name'
:
AText
:
=
MemDataset1
.
FieldByName
(
'Hint_Name'
)
.
AsString
;
end
;
end
;
See attached project.
Logged
LemonParty
Sr. Member
Posts: 393
Re: TDBGrid.OnGetCellHint determine cell
«
Reply #3 on:
August 20, 2025, 04:51:28 pm »
Thank you, wp. It works.
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
TDBGrid.OnGetCellHint determine cell
TinyPortal
© 2005-2018