Jump to content

The TUniDBFormattedNumberEdit component does not have a property where I can change the blankvalue.


pro_imaj

Recommended Posts

Hi,

The TUniDBFormattedNumberEdit component does not have a property where I can change the blankvalue.

Calculations are wrong because it returns -1 if there is no value in the field.

How do I make the value 0, which is -1 in case of blankvalue, when there is no data?

When there is a blankvalue in the TUniDBFormattedNumberEdit component, it solves this problem by setting it to 0. What is the solution in DB component?

Link to comment
Share on other sites

2 hours ago, pro_imaj said:

Add 1 TUniDBFormattedNumberEdit to the screen and connect any datasource.

The default value is 0. When you delete the 0 value, it becomes -1, so if there is no data on the screen, it becomes -1, I have to make it 0.

I couldn't reproduce your issue.

Link to comment
Share on other sites

39 minutes ago, pro_imaj said:

The example is attached.

Value should be 0 when there are no values.

test02.zip 26.75 kB · 1 download

procedure TMainForm.edtTeklifYuzdeChangeValue(Sender: TObject);
begin
  //UniNumberEdit1.Value := edtTeklifYuzde.Value;
  if edtTeklifYuzde.Value < 0 then
    UniNumberEdit1.Value := 0
  else
    UniNumberEdit1.Value := edtTeklifYuzde.Value;
end;

 

Link to comment
Share on other sites

Another solution:

1. 

procedure TMainForm.edtTeklifYuzdeChangeValue(Sender: TObject);
begin
  //UniNumberEdit1.Value := edtTeklifYuzde.Value;
  //if edtTeklifYuzde.Value < 0 then
  //  UniNumberEdit1.Value := 0
  //else
  //  UniNumberEdit1.Value := edtTeklifYuzde.Value;
end;

2. 

procedure TMainForm.edtTeklifYuzdeChange(Sender: TObject);
begin
  UniNumberEdit1.Value := edtTeklifYuzde.Value;
end;

3. 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  FDMemTable1.Append;
  FDMemTable1.Edit;

  with TUniNumberEdit(edtTeklifYuzde) do
  begin
    BlankValue := 0;
    AllowBlank := True;
  end;
end;

 

Link to comment
Share on other sites

4 hours ago, Sherzod said:

Another solution:

1. 

procedure TMainForm.edtTeklifYuzdeChangeValue(Sender: TObject);
begin
  //UniNumberEdit1.Value := edtTeklifYuzde.Value;
  //if edtTeklifYuzde.Value < 0 then
  //  UniNumberEdit1.Value := 0
  //else
  //  UniNumberEdit1.Value := edtTeklifYuzde.Value;
end;

2. 

procedure TMainForm.edtTeklifYuzdeChange(Sender: TObject);
begin
  UniNumberEdit1.Value := edtTeklifYuzde.Value;
end;

3. 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  FDMemTable1.Append;
  FDMemTable1.Edit;

  with TUniNumberEdit(edtTeklifYuzde) do
  begin
    BlankValue := 0;
    AllowBlank := True;
  end;
end;

 

Hi @Sherzod

I solved the problem with item 3. Thank you very much.

This error occurred because I couldn't make edtOfferYuzde.BlankValue := 0; These standards should be added to the component specifications. @Farshad Mohajeri

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...