In Grid Control push Enter?

Started by Sun_tk · 2008-07-29 12:04 UTC · 2 replies · SMF topic #384

Why Forms is closing when cursor in Grid and push Enter?
Hello,

you can avoid that using the CancelClose event of the form. I do this, too.

(defun cancel_edit ()
  (if isLabelEdit (dcl_Grid_CancelItemEdit MyGrid))
); cancel_edit

(defun c:OnCancelClose (isESCWasPressed)
  (cancel_edit)
  (/= isESCWasPressed 1) ;; avoids closing form after ENTER
); CancelClose

(defun c:OnBeginLabelEdit (intRow ontCol)
  (setq isLabelEdit T)
  ;; ... someting else, too
); c:OnBeginLabelEdit

(defun c:OnEndLabelEdit (intRow ontCol)
  ;; ... someting else, too
  (setq isLabelEdit nil)
); c:OnBeginLabelEdit

Fred
Thank you Fred, it's worked.