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.

Column Resizing and DoDragDrop

Thread ID:

Created:

Updated:

Platform:

Replies:

17079 Jul 30,2004 07:54 AM Jul 30,2004 08:35 AM Windows Forms 1
loading
Tags: GridControl
Steven Domingue
Asked On July 30, 2004 07:54 AM

I am trying handle a drag out of a GridControl that has GridResizeCellsBehavior.InsideGrid set. I handle the MouseDown event and gather all of the drag information. I call DoDragDrop and the drag starts. This part works ok. The problem is that once I call DoDragDrop I cannot resize the columns by dragging the column edge in the grid. It becomes a data drag, not a column resize drag. How can I detect in the MouseDown event whether I am on the column edge or in the middle of the cell? Thanks

Administrator [Syncfusion]
Replied On July 30, 2004 08:35 AM

Here is one try at it that gets the cell rectangle, and shrinks it a little, and then tests whether the point is in the shrunken rect.
private void gridControl1_MouseDown(object sender, MouseEventArgs e)
{
	int row, col;
	Point pt = new Point(e.X, e.Y);
	if(this.gridControl1.PointToRowCol(pt, out row, out col, -1))
	{
		Rectangle rect = this.gridControl1.ViewLayout.RangeInfoToRectangle(GridRangeInfo.Cell(row, col),
			             true, GridCellSizeKind.ActualSize);
		rect.Inflate(-3, -3);
		if(rect.Contains(pt))
		{
			Console.WriteLine("Inside cell");
		}
	}
}

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.

;