Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 09:55

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Editbutton in Dbgrideh
PostPosted: 17 Jan 2024, 14:11 
Offline

Joined: 14 Jul 2022, 08:46
Posts: 22
Hi
In dbgridEh how can i click the Editbutton (see the pic) using code :

I tried dbEgridEh1.Columns[0].EditButton.Click(sender ,true ) but i got error .

Pls you advise.


Attachments:
ehlib_grid.png
ehlib_grid.png [ 4.28 KiB | Viewed 2138 times ]
Top
 Profile  
 
PostPosted: 21 Jan 2024, 23:59 
Offline

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

An EditButton in a cell is just an image that is not attached to an object.
The picture becomes attached to the object only after opening the text editor for the cell.
When EditButton.Click is called, the EditButton.OnClick event is raised. If you need to call your event that you set up in Design-Time, you can simply call the function that you assigned to the EditButton.OnClick event.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 22 Jan 2024, 14:29 
Offline

Joined: 14 Jul 2022, 08:46
Posts: 22
in EditEh (pict attached) using this code jrnl_acc.DropDown(nil) it will dropdown without using mouse.
How can i dropdown in dbEdrifEh editbutton using code ?


Attachments:
ehlib_dropdawn.jpg
ehlib_dropdawn.jpg [ 9.35 KiB | Viewed 2102 times ]
Top
 Profile  
 
PostPosted: 06 Feb 2024, 00:59 
Offline

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

Try this code:

Code:
type
  TDBGridInplaceEditCrack = class(TDBAxisGridInplaceEdit);
  TDBGridEhCrack = class(TDBGridEh);

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
  Handled: Boolean;
  ColIdx: Integer;
begin
  ColIdx := 0;
  DBGridEh1.SetFocus;
  DBGridEh1.SelectedIndex := ColIdx;
  DBGridEh1.EditorMode := True;
  Handled := False;
  TDBGridInplaceEditCrack(DBGridEh1.InplaceEditor).ButtonDown(True, Handled);
  if not Handled then
    TDBGridEhCrack(DBGridEh1).EditButtonDefaultAction(DBGridEh1.InplaceEditor,
      nil, DBGridEh1.Columns[ColIdx].EditButton, nil, EmptyRect, DBGridEh1.Columns[ColIdx], True, Handled);
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 10 Feb 2024, 14:25 
Offline

Joined: 14 Jul 2022, 08:46
Posts: 22
Thank you.
what i want is to use the DropDwonForm not the editbutton DefaultAction.
Pls your Advise


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