Solved

Delphi - cxGrid event

Posted on 2013-02-05
2
1,647 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
[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
2 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 100 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 154
find a node in VST 2 93
How to renew a Delphi rad-studio licence? 5 95
FMX TEdit KeyUp handler detecting  "enter" key 4 63
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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