Ticket DQ49908
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Switch the mouse pointer that hovers over cxHyperLinkEdit data cells to crHandPoint

automatically change mouse pointer over hyperlink text

created 19 years ago

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!

Answers approved by DevExpress Support

created 19 years ago (modified 12 years ago)

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.

    Show previous comments (3)
    DevExpress Support Team 12 years ago

      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.

      DI DI
      Dirk Illenberger 12 years ago

        Perfect! Thank you very much.

        DevExpress Support Team 12 years ago

          You are always welcome, Dirk! :)

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.