Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 21:39

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 16 Dec 2016, 12:13 
Offline

Joined: 26 Jan 2016, 09:46
Posts: 56
Hi !

It was possible to change the display format of the column for a row ?

For example, i want to have
8.00 for row 1
12.0000 for row 2
14.0 for row 3
...

Thanks you !
Bye!


Top
 Profile  
 
PostPosted: 17 Dec 2016, 00:34 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

You can use TColumnEh.OnGetCellParams event handler to change Display Text

Code:
procedure TForm1.DBGridEh1Columns3GetCellParams(Sender: TObject;
  EditMode: Boolean; Params: TColCellParamsEh);
begin
  if MemTableEh1.RecNo = 1 then
  begin
    Params.Text := FormatFloat('#.00',MemTableEh1.FieldByName('Area').AsFloat);
  end else
    Params.Text := FormatFloat('#.0000',MemTableEh1.FieldByName('Area').AsFloat);
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 19 Dec 2016, 09:31 
Offline

Joined: 26 Jan 2016, 09:46
Posts: 56
Thanks you !
It works very week !

Good bye


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 90 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group