We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

change the mouse pointer to hand icon

Hello,  I am using a sfgrid to show some data, I want to change the mouse pointer to hand symbol(like hyperlink) to tell the user that the row/column is clickable.. Please give me solution for this. Thanks In advance


4 Replies

BR Balamurugan Rajaraman Syncfusion Team April 7, 2017 05:28 PM UTC

Hi Murali 
 
We have analyzed your query “How to change the move cursor Symbol while hover on the SfDataGrid”. You can able to achieve your requirement by using the PointerMoved event as like the below provided code sample. 
 
public MainPage() 
        { 
            this.InitializeComponent(); 
            this.PointerMoved += MainPage_PointerMoved; 
        } 
         
        private void MainPage_PointerMoved(object sender, PointerRoutedEventArgs e) 
        { 
            var point = e.GetCurrentPoint(this.dataGrid); 
            var p = this.dataGrid.GetVisualContainer().ScrollOwner.TransformToVisual(dataGrid).TransformPoint(point.Position); 
            var isInDataGrid = this.dataGrid.GetVisualContainer().PointToCellRowColumnIndex(p, false); 
            if (isInDataGrid.IsEmpty) 
            { 
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 0); 
            } 
            else 
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Hand, 0); 
        } 
 
 We have created the sample as per the requirement and attached that sample for your reference you can download it from the below location. 
 
Sample:  
 
Regards, 
Balamurugan R 



BR Balamurugan Rajaraman Syncfusion Team April 7, 2017 05:41 PM UTC

Hi Murali 
 
Please ignore our previous update. 
 
We have analyzed your query “How to change the move cursor Symbol while hover on the SfDataGrid”. You can able to achieve your requirement by using the PointerMoved event as like the below provided code sample. 
 
public MainPage() 
        { 
            this.InitializeComponent(); 
            this.PointerMoved += MainPage_PointerMoved; 
        } 
         
        private void MainPage_PointerMoved(object sender, PointerRoutedEventArgs e) 
        { 
            var point = e.GetCurrentPoint(this.dataGrid); 
            var p = this.dataGrid.GetVisualContainer().ScrollOwner.TransformToVisual(dataGrid).TransformPoint(point.Position); 
            var isInDataGrid = this.dataGrid.GetVisualContainer().PointToCellRowColumnIndex(p, false); 
            if (isInDataGrid.IsEmpty) 
            { 
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 0); 
            } 
            else 
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Hand, 0); 
        } 
 
 We have created the sample as per the requirement and attached that sample for your reference you can download it from the below location. 
 
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/1298441586638471.zip 
 
Regards, 
Balamurugan R 



MK MURALI KRISHNA April 8, 2017 11:58 AM UTC

Thanks for your reply Balamurugan.


PS Prasanth Saravanan Syncfusion Team April 10, 2017 12:42 PM UTC

Hi Murali, 
  
Thanks for your update. 
Please let us know if you need further assistance. 
  
Regards, 
 Prasanth.S

Loader.
Up arrow icon