Solved

Delphi - cxGrid event

Posted on 2013-02-05
2
1,603 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 36

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

19 Experts available now in Live!

Get 1:1 Help Now