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
MOVED: was the book "laza...
by
trev
[
Today
at 02:31:19 pm]
Problems with Crt and Dos...
by
pleumann
[
Today
at 01:51:02 pm]
Feature announcement: Fun...
by
Thaddy
[
Today
at 01:20:11 pm]
RP2040 with Picoprobe and...
by
MarkMLl
[
Today
at 01:08:00 pm]
Problem saving new projec...
by
rvk
[
Today
at 01:00:40 pm]
TListView and OwnerData
by
dbannon
[
Today
at 12:42:01 pm]
RISCV32 Embedded -> Addin...
by
kupferstecher
[
Today
at 12:34:15 pm]
Illegal type conversion s...
by
Fred vS
[
Today
at 12:31:16 pm]
How to determine Unicode ...
by
Manlio
[
Today
at 12:13:43 pm]
Custom Control causes QTr...
by
alanphys
[
Today
at 11:37:57 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Make DBGrid row unselectable (Read 2039 times)
pcurtis
Hero Member
Posts: 939
[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: 4528
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: 939
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