Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
[SOLVED] Make DBGrid row unselectable
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
What is the best free pot...
by
Alienizering
[
Today
at 06:53:59 pm]
msgrcv only succeeds if m...
by
MarkMLl
[
Today
at 06:47:45 pm]
backconnect sock proxy ? ...
by
ZainPeck
[
Today
at 05:50:54 pm]
LazReport: Error using Hi...
by
luca
[
Today
at 05:39:29 pm]
[SOLVED] TPointF Not Foun...
by
J-G
[
Today
at 04:41:43 pm]
How can i run application...
by
rvk
[
Today
at 03:42:58 pm]
Optimizing the counter co...
by
BrunoK
[
Today
at 03:39:06 pm]
LAMW - "This app has a bu...
by
Mongkey
[
Today
at 01:50:42 pm]
MOVED: TPointF Not Found ...
by
trev
[
Today
at 01:50:34 pm]
Custom Control causes QTr...
by
zeljko
[
Today
at 12:57:23 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Make DBGrid row unselectable (Read 2035 times)
pcurtis
Hero Member
Posts: 935
[SOLVED] Make DBGrid row unselectable
«
on:
December 25, 2021, 07:20:57 pm »
How do I make a DBGrid row un-selectable based on a field in the underlying dataset?
It should jump to the next valid available record, or if none available not move.
Thanks.
«
Last Edit: December 26, 2021, 08:53:45 am by pcurtis
»
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
Handoko
Hero Member
Posts: 4520
My goal: build my own game engine using Lazarus
Re: Make DBGrid row unselectable
«
Reply #1 on:
December 25, 2021, 07:54:08 pm »
I believe that won't be easy. Because TDBGrid is for simply showing data of the linked datasource, it will be less flexible for doing 'other' things.
But if you don't mind using TStringGrid, I haven't tried but it should be much easier.
Here I have an example for programmatically moving the focus cell:
https://forum.lazarus.freepascal.org/index.php/topic,37286.msg250687.html#msg250687
So you can set any condition you like, and then move the selection to wherever you want. But if you have problem loading data to show it to a TStringGrid, here I have a demo showing how to load data from a dbf file to StringGrid:
https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249208.html#msg249208
Logged
pcurtis
Hero Member
Posts: 935
Re: Make DBGrid row unselectable
«
Reply #2 on:
December 25, 2021, 08:16:45 pm »
OK, thanks I'll have a look.
@Handoko - I've been looking and found the solution I need. I will stop using DBGrid, Stringgrid is, as you said, much better. You have to think a little differently but it's worth it.
Thanks.
«
Last Edit: December 26, 2021, 09:29:40 am by pcurtis
»
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
[SOLVED] Make DBGrid row unselectable
TinyPortal
© 2005-2018