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.

Double Click Functionality

Thread ID:

Created:

Updated:

Platform:

Replies:

8853 Nov 23,2003 09:31 AM Nov 23,2003 11:54 AM Windows Forms 1
loading
Tags: GridControl
Steve
Asked On November 23, 2003 09:31 AM

When double clicking on the row header, the apparent functionality is to re-size the column to a default size. Is this correct? What is the default size, and how can I prevent this functionality?

Administrator [Syncfusion]
Replied On November 23, 2003 11:54 AM

This is by design. Double-click will reset the column to its default width. You can set the default with with code like grid.DefaultRowHeight = xxx. However the ResizingColumns event lets you implement whatever behavior you want. Here is the code snippet that autosizes the column.
private void grid_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
	if(e.Reason.Equals(GridResizeCellsReason.DoubleClick))
	{
		GridRangeInfo range = GridRangeInfo.Cols(1,3); 
		this.grid.Model.ColWidths.ResizeToFit(range);
		e.Cancel = true;
	}
}
Here is a little sample.

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.

;