Jump to content

uniDBGrid OnSetCellValue


Yang91

Recommended Posts

Hi all,

On a uniDbGrid, I want to have a cell content updated based on two other cells content (basically on total = qte * price).

I wrote a OnSetCellValue which is as basic as :

if (aField.FieldName='PU') then
  begin
  if JvmItems.State<>dsEdit then JvmItems.Edit;
  JvmItems.FieldByName('TotalHT').AsCurrency:=jvmItems.FieldByName('Quantite').AsInteger*cValue); // cValue is a float of Value
  JvmItems.FieldByName('PU').AsCurrency:=cValue;
  jvmItems.Post;
  end;

It works fine if I validate the cell (pressing Enter), if I switch to another row or if I press shift-tab (going on the left side cell).

But if I press tab, the content of the Total cell stays the same.

It looks like the content of the Total cell doesn't reflect the new value of the field.

Any idea ?

image.gif.d2b25e51e647094f35203e74dfd6ba50.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...