Jump to content

UniDBEdit does not work with GetText from TField


Recommended Posts

Hi,

The ID field of your XML is 2 in size

image.png.9e3763c2bbbc8a1853a3c1646a330a5c.png

Maybe this will solve ...

procedure TMainForm.FDMemTable1IDGetText(Sender: TField; var Text: string;
  DisplayText: Boolean);
begin
  if Sender.AsVariant = Null then
    Exit;
  Text := FormatFloat('00', StrToFloat(Sender.AsString));
end;

procedure TMainForm.FDMemTable1IDSetText(Sender: TField; const Text: string);
begin
  Sender.AsString := FormatFloat('00', StrToFloat(Text));
end;

Regards,

Eduardo Belo

Link to post
Share on other sites

Thanks for the suggestion Eduardo,

But that's not my problem. If you look at the source code I'm doing exactly the same thing with 4 digits.

The problem is the UniDBEdit does not update with the GetText value, passing 2, 4 or N digits it "should" be updated equal to the VCL.

------------------------------------------------------------------

PT-BR:

Obrigado pela sugestão Eduardo,

Mas não é esse o meu problema. Se o olhar o código fonte estou fazendo exatamente a mesma coisa porém com 4 dígitos. 

O problema é o UniDBEdit não atualizar com o valor do GetText, passando 2, 4 ou N dígitos ele "deveria" ser atualizado igual ao VCL.

Link to post
Share on other sites

 

The problem is not the UniDBEdit but the UniDBGrid. If you disable the UniDBGrid, the error does not occur. Maybe this behavior is a bug.

PT-BR:

O problema não é o UniDBEdit e sim o UniDBGrid. Se você desativar o UniDBGrid não acontece o erro. Talvez esse comportamento seja um bug.

Link to post
Share on other sites

I tested without grid as well and the problem occurred anyway. Can you provide an example?

--------------------------- 

Testei sem o grid também e o problema ocorreu mesmo assim. Pode disponibilizar um exemplo?

Link to post
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...