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
Solved

Delphi - cxGrid event

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…

791 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