Solved

Jump automatically to next column in DBGrid

Posted on 2002-04-07
6
242 Views
Last Modified: 2010-04-04
Hi Experts,

One of my Delphi 5 applications has a DBGrid where article numbers should be entered. All article numbers are exactly 6 characters long.
What I want is, when a user enters an article number in the DBGrid, the cursor in the DBGrid automatically jumps to the next column when 6 characters have been entered. As far as I can see, all events in the DBGrid or in the Query are triggered when the Enter key is pressed. But I don't want to wait until the user presses the Enter key. As all article numbers are 6 characters long the DBGrid must automatically jump to the next column when the 6 characters are entered. And because this next column contains always 1 character, the DBGrid should jump to the third column when 1 character is entered in this column (without pressing the Enter key !!).

Is there a way to do this?

Thanks,
JDN
0
Comment
Question by:JDN
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:ginsonic
Comment Utility
listening
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
it's not too hard,
sample follows
(no delphi on hand yet,
but i've already done something like that)

meikl ;-)
0
 
LVL 1

Author Comment

by:JDN
Comment Utility
Well Meikl,

Do you have a sample for me?

JDN
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 30 total points
Comment Utility
well,
i've done it with another grid as the tdbgrid,
but basically it works like

in the onkeyup-event search for the tinplaceeditor-object,
there you've the selstart-property, which you can compare with the maxlength of the associated tfield,
if the values are equal, then perform a keybd_event call with the enter-key

a sample i can provide at friday,
since i've no time until then

meikl ;-)
0
 
LVL 1

Author Comment

by:JDN
Comment Utility
Meikl,

Thanks for the advice (although the promised example would have been helpfull). Meanwhile I figured the thing it out myself using your suggestions.

I will be fair and give you the points.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
ooops, sorry, had forgotten this q.

glad you got it work,
glad to helped you

meikl ;-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now