This is what I want to do:
on a gridview I have a column of type Hyperlink. This column is readonly and cell select is false. When the user moves over this column he should see the mousepointer changing to crHandPoint (regardless if the cell is in editmode or not). But only if the mouse is over the hyperlink text and not somewhere else on the cell (cause of an image column there is a very big rowheight). Is this possible or how can this be simmulated?
In other words: is a mouse behaviour like on a hyperlink on a website possible?
Thanks!
We have closed this ticket because another page addresses its subject:
Switch the mouse pointer that hovers over cxHyperLinkEdit data cells to crHandPointautomatically change mouse pointer over hyperlink text
Answers approved by DevExpress Support
Hi!
You can use the View's OnMouseMove event handler to determine whether the cursor is upon the needed column via the HitTest technique (see the Express Quantum Grid's "Understanding HitTests" help topic). Then you can change the cursor type.
…
procedure TForm1.cxGrid1DBTableView1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var
Ht: TcxCustomGridHitTest;
begin
Ht := TcxGridSite(Sender).GridView.Viewinfo.GetHitTest(X,Y);
If (Ht is TcxGridRecordCellHitTest) and
(TcxGridRecordCellHitTest(Ht).Item.Properties is TcxHyperLinkEditProperties) then
Screen.Cursor := crHandPoint
else
Screen.Cursor := crDefault;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Screen.Cursor <> crDefault then
Screen.Cursor := crDefault;
end;
Attached is a sample project which shoud help you.
Thanks,
Nicolas.
Sure, Dirk! :)
To solve this issue, use the overloaded version of the GetProperties method that takes the TcxCustomGridRecord object as a parameter. In this case, you will be able to obtain properties used in a particular cell.
I have slightly modified your sample project to demonstrate this approach in action. I hope this will help you achieve the required functionality.