I have a grid on my form attached to a table. I have goEditing enabled. I have four FormEditLinks for four of the six columns that I allow editing. A column Item has editing set to edNormal. if a user uses the mouse or keyboard arrow keys to land in a cell and edit the value and presses enter, everything works as it should. But if he uses anything to land in a cell and presses the enter without making a change, it zeros the value in the cell and recalculates the row value using the zero. I have been searching for a way to trap this, so if a change is not made, it does not zero the value. I hope someone can help me and thank you in advance.
It might depend on how you have implemented FormControlEditLink.OnGetEditorValue/FormControlEditLink.OnSetEditorValue. Since there is no info here about what you implemented, I cannot judge.
Also, you mention: if user uses key or mouse to land the cell it work and "if he uses anything to land" ... so what exactly does this mean? With what exact other way than mouse or keyboard do you "land in a cell"?
Thanks for the reply, Bruno. I have not implemented anything in get or set. I will read the manual and try to use them to figure this out.
Here is my problem, hopefully, explained better.
I assign an edit field to the control and use the update record function of the field to change values. I do not use the get or set field.
What I have is a dbGrid connected to a table. I am using eight columns, of which only four are editable. I have assigned four Edit fields to 4 Edit Controls. I have only used the EditorFocus and Editor Properties events.
What I meant to say in my first note was if the user is moves from cell to cell using the mouse or keyboard arrows, not changing any values, all values remain as they were. But, if he lands in a cell and does not change the value, and instead of using the mouse or the arrow keys to move to a different cell, clicks the enter key, the cell value goes to zero. This is what I am trying to trap.
If you have a demo someplace or one that I missed in all the demos that you already provided, please point me to them.
I am sorry for the lengthy response
In a TDBAdvGrid, the grid is supposed to handle the retrieval and updating of the DB field values when editing is happening and as such, it is expected that FormControlEditLink.OnGetEditorValue/FormControlEditLink.OnSetEditorValue are implemented as these communicate the values from inplace editor to the grid and vice versa. And the grid deals with this data to get or update the data field value.
Use of FormControlEditLink is explained here: