Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delphi - cxGrid event

Posted on 2013-02-05
2
Medium Priority
?
1,758 Views
Last Modified: 2013-02-07
Hello,
I have a cxgrid with a column set as a property LookupComboBox,
I put this event onCloseUp cidce that allows me to add a new record with the focus in the same column.

  cxGrid1DBTableView1.DataController.PostEditingData;
  cxGrid1DBTableView1CODICE.EditValue:=MyTable2CODICE.AsString;
  cxGrid1DBTableView1.DataController.Append;
  cxGrid1DBTableView1DESCRIZIONE.Selected := True;

Open in new window


I would like to add a new record when the user presses the enter key but I can not figure out how to
0
Comment
Question by:danz67
2 Comments
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 300 total points
ID: 38858312
why not use the insert key ?

sometimes users ask for a solution like this because they don't know the shortcut key
enter is very widely used already in the grid
it could break the existing functionality

in the options.behavior did you try playing with the checkboxes
GoToNextCellOnEnter and FocusCellOnCycle
and datacontroller.options dcoInsertOnNewItemRowFocusing ?
0
 

Author Comment

by:danz67
ID: 38858777
I saw these settings,
Now when I press the enter button, the focus moves to the next record,
but in the current record is not the most blank,
but if I select a value from the current record taken from loockup all goes well
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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

971 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