Description:
I want to display my own cell hints when the mouse moves over grid cells. How to do this?
Answer:
To implement this task you should handle the GridView’s OnMouseMove event. Within this event you should check whether the mouse is placed over a grid cell:
Code//determine the current mouse position
AHitTest := cxGrid1DBTableView2.GetHitTest(X, Y);
//hide displayed hint if mouse is not over a grid cell
if AHitTest.HitTestCode <> htCell then
begin
Timer1.Enabled := False;
cxHintStyleController1.HideHint;
Exit;
end;
If so you should display a cell hint. To display/hide a hint you can use the TcxHintStyleController component. Simply call its ShowHint method to display a hint and its HideHint method to hide the hint which is currently displayed.
The attached project demonstrates this approach.
Please note that the GridView.OptionsBehavior.CellHints property is disabled. Otherwise, the GridView will show its CellHints too.
Hello, I have been seeking help to implement custom hints in pivotgrid, but was unable to make it work.
Would send me an example?
Thanks!
Wander
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T220686: How to implement custom hints in pivotgrid. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Example with TClientDataSet