EhLib.Com
https://forum.ehlib.com/en/

search count
https://forum.ehlib.com/en/viewtopic.php?f=5&t=1123
Page 1 of 1

Author:  redsea71 [ 30 Dec 2021, 07:35 ]
Post subject:  search count

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 1778 times ]

Author:  EhLibSupport [ 13 Jan 2022, 11:58 ]
Post subject:  Re: search count

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;

Author:  redsea71 [ 17 Jan 2022, 09:16 ]
Post subject:  Re: search count

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 1706 times ]

Author:  EhLibSupport [ 18 Jan 2022, 16:56 ]
Post subject:  Re: search count

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;

Author:  redsea71 [ 24 Jan 2022, 18:04 ]
Post subject:  Re: search count errors

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 1675 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/