Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Jump automatically to next column in DBGrid

Posted on 2002-04-07
6
Medium Priority
?
268 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
Independent Software Vendors: 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 90 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

610 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