Solved

Jump automatically to next column in DBGrid

Posted on 2002-04-07
6
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 6924602
listening
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6925144
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
ID: 6929555
Well Meikl,

Do you have a sample for me?

JDN
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Accepted Solution

by:
kretzschmar earned 30 total points
ID: 6930600
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
ID: 6952716
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
ID: 6952724
ooops, sorry, had forgotten this q.

glad you got it work,
glad to helped you

meikl ;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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