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

Autosizing columns

Thread ID:





2905 Feb 19,2003 03:36 PM UTC May 14,2003 10:27 AM UTC WinForms 4
Tags: GridControl
Ivan Pelly
Asked On February 19, 2003 03:36 PM UTC

Are there any events raised, other than ColWidthsChanged, when the user double-clicks on the divider between columns to resize the column? Thanks!

Administrator [Syncfusion]
Replied On February 19, 2003 08:04 PM UTC

See ResizingColumns. It is called for hittesting for that line, when pressing the mouse and dragging the sizing line. Stefan

Terry Foster
Replied On May 13, 2003 06:31 PM UTC

I have noticed that the default behavior for double clicking the column divider (GridControl) is to set the size of the column to the 'DefaultColWidth' property of the grid. This seems a little strange as all other grids I've worked with size it to the longest text in any of the cells of the column. Is there an option to change the behavior of the double click to do this? If not, what would be the best way to implement this? Thanks, Terry

Administrator [Syncfusion]
Replied On May 13, 2003 07:31 PM UTC

There is no property that does this, but you can do it handling the ResizingCols event.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
	if(e.Reason == GridResizeCellsReason.DoubleClick)
		this.gridControl1.ColWidths.ResizeToFit(e.Columns, GridResizeToFitOptions.IncludeHeaders);
		e.Cancel = true;

Terry Foster
Replied On May 14, 2003 10:27 AM UTC

Perfect - thank you. Terry


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