Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 17 May 2022, 05:03

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: search count
PostPosted: 30 Dec 2021, 07:35 
Offline

Joined: 15 Mar 2021, 16:33
Posts: 28
Hi

What is the properties or how to get the search count(redcolor) in DBGridEh and how to remove the other properties(green color)(see the pict)

Thank you


Attachments:
ehlib.jpg
ehlib.jpg [ 85.1 KiB | Viewed 256 times ]
Top
 Profile  
 
 Post subject: Re: search count
PostPosted: 13 Jan 2022, 11:58 
Offline

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

You can use TDBGridSearchPanelControlEh.GetSearchInfoBoxText method to get found values as text. But is is protected.
See the code below to access this method.

Other buttons is hardcoded in the method
procedure TSearchPanelControlEh.FindEditorUpdateModified(Sender: TObject);
and other methods
You need to set FFindButtons[AllButtons].Visible False.
But setting this property from an external function doesn't always work.

Code:
type
  TDBGridEhCrack = class(TDBGridEh);
  TDBGridSearchPanelControlEhCrack = class(TDBGridSearchPanelControlEh);

procedure TForm1.Button1Click(Sender: TObject);
begin
  TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).FindButtons[gnfbSearchInfoBoxEh].Visible := False;
  TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).FindButtons[gnfbCancelSearchFilterEh].Visible := False;
  TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).FindButtons[gnfbFindNextEh].Visible := False;
  TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).FindButtons[gnfbFindPrevEh].Visible := False;
  TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).FindButtons[gnfbOptionsEh].Visible := False;

  Button1.Caption := TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).GetSearchInfoBoxText;
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
 Post subject: Re: search count
PostPosted: 17 Jan 2022, 09:16 
Offline

Joined: 15 Mar 2021, 16:33
Posts: 28
Hi
Thank you for reply.
I got an error for the code you posted(see pict ). { second question}

My first question it What ( the properties or how to get the search count(redcolor) in DBGridEh ).

Regards


Attachments:
ehlib.jpg
ehlib.jpg [ 40.29 KiB | Viewed 184 times ]
Top
 Profile  
 
 Post subject: Re: search count
PostPosted: 18 Jan 2022, 16:56 
Offline

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

Quote:
I got an error for the code you posted(see pict ).


Add SearchPanelsEh unit in uses clause.

Quote:
My first question it What ( the properties or how to get the search count(redcolor) in DBGridEh ).


You can get is as Text.
Button1.Caption := TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).GetSearchInfoBoxText;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
 Post subject: Re: search count errors
PostPosted: 24 Jan 2022, 18:04 
Offline

Joined: 15 Mar 2021, 16:33
Posts: 28
my code
procedure Tfrm.DBGridEh1KeyPress(Sender: TObject; var Key: Char);
begin
label3.Caption:=TDBGridSearchPanelControlEhCrack(TDBGridEhCrack(DBGridEh1).FSearchPanelControl).GetSearchInfoBoxText;
end;

Also compiler errors see the pict


Attachments:
ehlib.jpg
ehlib.jpg [ 16.76 KiB | Viewed 153 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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