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

Different drag cursors for row and column drags

Thread ID:

Created:

Updated:

Platform:

Replies:

17214 Aug 3,2004 04:11 PM Aug 3,2004 04:46 PM Windows Forms 1
loading
Tags: GridControl
Sue Harris
Asked On August 3, 2004 04:11 PM

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 04:46 PM

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.

CONFIRMATION

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.

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.

;