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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Different drag cursors for row and column drags

Thread ID:





17214 Aug 3,2004 08:11 PM UTC Aug 3,2004 08:46 PM UTC WinForms 1
Tags: GridControl
Sue Harris
Asked On August 3, 2004 08:11 PM UTC

Hi, Is it possible to change the grid cursors for the drag operation so that the column drag cursor is different from the row drag cursor? Thanks, Sue

Administrator [Syncfusion]
Replied On August 3, 2004 08:46 PM UTC

In general, the easiest way to change a grid cursor is to derive the grid and override OnSetCursor. In the override, explicitly set the Cursor.Current static varaible to the special cursor where ever you want it. For example, below is code that sets a cross cursor over cell 2,2.
public class MyGridControl : GridControl
	protected override void OnSetCursor(ref Message m)
		base.OnSetCursor(ref m);
		Point pt = this.PointToClient(Control.MousePosition);
		int row, col;
		if(this.PointToRowCol(pt, out row, out col, -1)
			&& row == 2 && col == 2)
			Cursor.Current = Cursors.Cross;
You can also do the by deriving GridDragSelectMouseController and overriding Cursor to provide the cursor that way. It would take a little more work than just deriving the grid.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon