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

Column Resizing and DoDragDrop

Thread ID:





17079 Jul 30,2004 11:54 AM UTC Jul 30,2004 12:35 PM UTC WinForms 1
Tags: GridControl
Steven Domingue
Asked On July 30, 2004 11:54 AM UTC

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 12:35 PM UTC

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);
			Console.WriteLine("Inside cell");


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