unexpected OnKillFocus event inside grid

Started by VovKa, December 20, 2011, 09:03:56 AM

Previous topic - Next topic

VovKa

the attached files are slightly modified versions of sample files
i've switched on OnKillFocus event and  added
Code (autolisp) Select
(defun c:Grid_Dcl-1_grid1_OnKillFocus (/) (princ "OnKillFocus ") (princ))
OnKillFocus triggers whenever you try to edit grid cells with "drop-down capability" (type 18, 36, 37...), in this example rows 4-5-6-7

owenwengerd

I didn't look at your code, but I would expect the grid control to lose focus when the dropdown control gains focus.

VovKa

dropdown (or combo strings) control being a cell is a part of a grid.
why should the grid lose focus then?

ps the code attached to the first post is not mine it's a sample from opendcl package.

Fred Tomke

Hi, VovKa,

the grid looses the control because any control that is shown when a cell is going to be edited is an other control but not the grid itself.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Fred Tomke

You can embed the code which shall be executed in the KillFocus event from the GridEditState. Just catch the OnStartCellEdit event and set a variable to T (for example) and set it to nil during OnEndCellEdit. Within OnKillFocus you can ask the state of the variable. That's all.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

VovKa

i just thought it was a bug
now i understand
thank you Fred