Solved

Delphi - cxGrid event

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

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month7 days, 9 hours left to enroll

632 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