Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED]DBGrid, the cursor won't move to the persistent field.
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
Automatic generation of *...
by
PeterBB
[
Today
at 01:38:51 pm]
Finding List of Fonts & P...
by
J-G
[
Today
at 01:22:49 pm]
Fast Canvas Library V1.05...
by
microxa
[
Today
at 01:11:53 pm]
TyControls: a custom-draw...
by
Antek
[
Today
at 12:07:39 pm]
Star Wars Galaxian
by
paweld
[
Today
at 11:09:28 am]
PO-Editor MyLangEdit3 now...
by
dbannon
[
Today
at 07:55:47 am]
Application triggers mess...
by
JanRoza
[
Today
at 12:26:52 am]
[solved] form reset/reloa...
by
ADMGNS
[August 08, 2026, 09:58:42 pm]
Create small language
by
ADMGNS
[August 08, 2026, 09:52:19 pm]
Advatage Database server
by
neobrasil08
[August 08, 2026, 08:42:18 pm]
QGradientTrackPanel: A Fu...
by
Ed78z
[August 08, 2026, 07:22:09 pm]
How get listy of FieldDat...
by
Aruna
[August 08, 2026, 04:02:16 pm]
Identify network devices
by
LemonParty
[August 08, 2026, 03:44:03 pm]
how to connect to mariadb...
by
Mike.Cornflake
[August 08, 2026, 12:25:31 pm]
New charts
by
Boleeman
[August 08, 2026, 11:24:34 am]
Unleashed Pascal (async/a...
by
Fibonacci
[August 08, 2026, 08:11:20 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED]DBGrid, the cursor won't move to the persistent field. (Read 1370 times)
Focus77
New Member
Posts: 25
[SOLVED]DBGrid, the cursor won't move to the persistent field.
«
on:
June 08, 2020, 10:14:11 pm »
Hi every body!
I have a dbgrid with 5 fields+a persistent field.
Autoadvance is at aaRightDown.
I use RETURN to move between the columns .
But when the cursor is on the fifth column, it would not move to the persistent one.
is it a bug?
«
Last Edit: June 10, 2020, 06:51:44 pm by Focus77
»
Logged
My goal is to make a web Application
using HTTPServer
jamie
Hero Member
Posts: 7884
Re: DBGrid, the cursor won't move to the persistent field.
«
Reply #1 on:
June 08, 2020, 11:12:18 pm »
Isn't a persistent field a Read only? if so then what good would be the cursor there ?
Logged
The only true wisdom is knowing you know nothing
Focus77
New Member
Posts: 25
Re: DBGrid, the cursor won't move to the persistent field.
«
Reply #2 on:
June 08, 2020, 11:40:18 pm »
Hi there
Of course the persistent field is a read only, but the cursor must cross it, in order to get
the next row.
for this I used the next code:
Code: Pascal
[Select]
[+]
[-]
procedure
TF_MAINFORM
.
DBGrid2KeyDown
(
Sender
:
TObject
;
var
Key
:
Word
;
Shift
:
TShiftState
)
;
begin
if
key
=
VK_RETURN
then
if
DBGrid2
.
SelectedColumn
.
Index
=
4
then
DBGrid2
.
SelectedIndex
:
=
5
;
end
;
«
Last Edit: June 08, 2020, 11:42:00 pm by Focus77
»
Logged
My goal is to make a web Application
using HTTPServer
jamie
Hero Member
Posts: 7884
Re: DBGrid, the cursor won't move to the persistent field.
«
Reply #3 on:
June 09, 2020, 12:04:03 am »
maybe you should be cycling the columns each time you move up or down and always check for the field type and if not desirable then go to the next one until you fine one that is ..
if you come to the end before you find one then you just don't move …
Logged
The only true wisdom is knowing you know nothing
Focus77
New Member
Posts: 25
Re: DBGrid, the cursor won't move to the persistent field.
«
Reply #4 on:
June 09, 2020, 10:53:49 pm »
Hi every one !
@jamie
In fact the only fields I can input the data are 1,2 and 3.
the code became:
Code: Pascal
[Select]
[+]
[-]
procedure
TF_MAINFORM
.
DBGrid2KeyDown
(
Sender
:
TObject
;
var
Key
:
Word
;
Shift
:
TShiftState
)
;
begin
if
key
=
VK_RETURN
then
if
DBGrid2
.
SelectedColumn
.
Index
<
3
then
DBGrid2
.
SelectedIndex
:
=
DBGrid2
.
SelectedIndex
+
1
else
begin
DBGrid2
.
SelectedIndex
:
=
1
;
if
not
MDT
.
T_NOTE
.
EOF
then
MDT
.
T_NOTE
.
Next
end
;
end
;
«
Last Edit: June 10, 2020, 06:52:18 pm by Focus77
»
Logged
My goal is to make a web Application
using HTTPServer
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED]DBGrid, the cursor won't move to the persistent field.
TinyPortal
© 2005-2018