Jump to content

DbGrid Column TUniNumberEdit Editor FAILS TO PAINT CORRECTLY


Recommended Posts

I have a DBGrid with a TUniNumberEdit Editor for Floating Numbers set to 2 Decimal places that fails to paint only 2 decimal places, please advise - thanks.

    // GST
    nmInvEdit2.Alignment:= taRightJustify;
    nmInvEdit2.AllowBlank:= False;
    nmInvEdit2.DecimalSeparator:= '.';
    nmInvEdit2.DecimalPrecision:= 2;
      // GST
      Columns.Add;
      Columns.Items[i].FieldName:= 'GST';
      Columns.Items[i].Visible:= True;
      Columns.Items[i].Title.Alignment:= taRightJustify;
      Columns.Items[i].Title.Caption:= '$GST';
      Columns.Items[i].Width:= 100;
      Columns.Items[i].Editor:= nmInvEdit2;
      //Columns.Items[i].Flex:= 1;
      Columns.Items[i].Font.Color:= clBlack;
      Columns.Items[i].Sortable:= True;
      Columns.Items[i].ShowSummary:= False;

 

GridEditorNumber.jpg

Link to post
Share on other sites

When the grid is first loaded from the data-source more than 2 decimal places are shown.

If I edit then after post the 2 decimal place rule is adhered to.

How do I make the grid on first load paint the 2 decimal place rule ?

Link to post
Share on other sites
On 8/6/2020 at 12:40 AM, andyhill said:

I have a DBGrid with a TUniNumberEdit Editor for Floating Numbers set to 2 Decimal places that fails to paint only 2 decimal places, please advise - thanks. 


    // GST
    nmInvEdit2.Alignment:= taRightJustify;
    nmInvEdit2.AllowBlank:= False;
    nmInvEdit2.DecimalSeparator:= '.';
    nmInvEdit2.DecimalPrecision:= 2;

      // GST
      Columns.Add;
      Columns.Items[i].FieldName:= 'GST';
      Columns.Items[i].Visible:= True;
      Columns.Items[i].Title.Alignment:= taRightJustify;
      Columns.Items[i].Title.Caption:= '$GST';
      Columns.Items[i].Width:= 100;
      Columns.Items[i].Editor:= nmInvEdit2;
      //Columns.Items[i].Flex:= 1;
      Columns.Items[i].Font.Color:= clBlack;
      Columns.Items[i].Sortable:= True;
      Columns.Items[i].ShowSummary:= False;

 

GridEditorNumber.jpg

Hi,

I can't reproduce the issue. Can you please attach a test case?

 

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