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
Why does the call via fun...
by
Remy Lebeau
[
Today
at 05:49:24 pm]
delete cookies
by
Leledumbo
[
Today
at 05:14:27 pm]
[hacked for now] Changing...
by
jamie
[
Today
at 04:40:15 pm]
Error: Enumeration symbol...
by
nanobit
[
Today
at 04:17:38 pm]
AI interactions
by
Zvoni
[
Today
at 02:19:48 pm]
TLazSerial : serial port ...
by
dbannon
[
Today
at 12:41:12 pm]
Recomendations for conver...
by
kompustelnik
[
Today
at 11:20:05 am]
Qt6 / X11: problem with G...
by
paweld
[
Today
at 11:14:43 am]
[Solved] Lookup field: er...
by
BlueIcaro
[
Today
at 09:59:57 am]
connecting to mariadb
by
Zvoni
[
Today
at 09:31:54 am]
LCL Web Native with D2Bri...
by
egsuh
[
Today
at 08:10:14 am]
Access Violation - Databa...
by
Xenno
[
Today
at 06:21:52 am]
Question re. FCL's ssocke...
by
Curt Carpenter
[
Today
at 12:22:45 am]
SpkToolbar custom update
by
wp
[December 14, 2025, 11:55:55 pm]
MVP made easier.
by
cdbc
[December 14, 2025, 05:14:40 pm]
Lazarus is not working
by
Fred vS
[December 14, 2025, 05:14:20 pm]
TIBDataSet "Closing"? on ...
by
RedOctober
[December 14, 2025, 04:52:18 pm]
Running External Tools
by
JuhaManninen
[December 14, 2025, 04:08:28 pm]
The start of yet another ...
by
TBMan
[December 14, 2025, 03:16:21 pm]
Need help with Runcommand...
by
marcov
[December 14, 2025, 12:46:25 pm]
Military Grade Directives
by
Thaddy
[December 14, 2025, 11:46:44 am]
Cannot find Online Packag...
by
Thaddy
[December 14, 2025, 11:37:58 am]
Anyone interested in help...
by
ad1mt
[December 14, 2025, 08:56:20 am]
Hashing pointers by using...
by
440bx
[December 14, 2025, 03:16:33 am]
exception external SIGSEG...
by
dseligo
[December 14, 2025, 02:24:28 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TDBGrid.OnGetCellHint determine cell (Read 1775 times)
LemonParty
Sr. Member
Posts: 391
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: 5649
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: 13270
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: 391
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