Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 07:49

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 05 Sep 2014, 16:48 
Offline

Joined: 16 Jul 2014, 17:35
Posts: 25
Hello,
I want to change the height of DBGridEh depending on the number of its rows, Suppose DBgridEh1 has n rows, its height=Fixed row height+n*row height.
How do calculate it based on properties and methods of DBGridEh?


Top
 Profile  
 
PostPosted: 07 Sep 2014, 21:03 
Offline
Администратор

Joined: 22 Dec 2011, 20:19
Posts: 335
Hello

Here is a sample code

Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  DBGridEh1.ClientHeight :=
    MemTableEh1.RecordCount * DBGridEh1.DefaultRowHeight +
    MemTableEh1.RecordCount +  // Extra Height for row lines
    TDBGridEhCrack(DBGridEh1).RowHeights[0] + //Title height
    + 1 // Title line
  ;
end;


Demo project is attached.

Best regards
Admin


Attachments:
GridHeightForDataSetRecords.zip [3.02 KiB]
Downloaded 274 times

_________________
Best regards
Admin
Top
 Profile  
 
PostPosted: 09 Sep 2014, 00:33 
Offline

Joined: 16 Jul 2014, 17:35
Posts: 25
Hello, Administrator
Thanks a lot for your help
What is TDBGridEhCrack class?


Top
 Profile  
 
PostPosted: 09 Sep 2014, 13:57 
Offline

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

TDBGridEhCrack is a class declared to access protected methods and fields of TDBGridEh.

Code:
type
  TDBGridEhCrack = class(TDBGridEh);

_________________
Best regards
EhLib Support Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 43 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