Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 23:16

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 30 Jan 2022, 13:36 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
See this example attached works with DbGrid but does not work with DBGridEh
I enabled ShowHint on Grid and ToopTips on columns

Code:
Function TForm1.ChangeHint(C: TControl; Const Hint: String; p: TPoint): Boolean;
begin
if Hint <> OldHint then begin
  OldHint := C.Hint;

  C.Hint := Hint;

  Application.ActivateHint(p);
end;

procedure TForm1.DBGridEh1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
Var Dados : string;
begin
Dados := DBGridEh1.DataSource.Dataset.FieldByname('CODIGO').Asstring + '   ';
Dados := Dados + DBGridEh1.DataSource.Dataset.FieldByname('MERCADORIA').Asstring + #13;

ChangeHint(TDBGridEh(Sender),  Dados +  '  -  TDBGridEh', TDBGridEh(Sender).ClientToScreen(Point(X, Y)));

end;

end;



Attachments:
Hint Columns DBGrid.7z [16.11 KiB]
Downloaded 55 times
Top
 Profile  
 
PostPosted: 31 Jan 2022, 19:19 
Offline

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

In the DBGridEh, each cell has its own algorithm for displaying hints.
To display the same hint for each grid cell, add the OnDataHintShow event handler like this:

Code:
procedure TForm1.DBGridEh1DataHintShow(Sender: TCustomDBGridEh;
  CursorPos: TPoint; Cell: TGridCoord; InCellCursorPos: TPoint;
  Column: TColumnEh; var Params: TDBGridEhDataHintParams;
  var Processed: Boolean);
begin
  Params.HintStr := Sender.Hint;
  Processed := True;
end;

_________________
Best regards
EhLib Support Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 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:  
Powered by phpBB® Forum Software © phpBB Group