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.

Autofit by doubleclicking right side of header row . .

Thread ID:

Created:

Updated:

Platform:

Replies:

38063 Dec 5,2005 11:35 AM Dec 5,2005 12:59 PM Windows Forms 1
loading
Tags: GridControl
Adam K.
Asked On December 5, 2005 11:35 AM

In excel if i double click on the right side of the header row in a column, it autofits for the entire column. with syncfusion it seems to only autofit the header row and ignore the rest of the rows in that column. Is there a way to mimic the excel behavior. thks, ak

Administrator [Syncfusion]
Replied On December 5, 2005 12:59 PM

The default behavior is to restrict the resizing to the visible grid for performance reasons. If you want to remove this restrictions, you can subscribe to teh ResizingColumsn event and do the resizing yourself. If you want the doubleclick to behave differently, you can handle this event.
private void grid_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
	if(e.Reason.Equals(GridResizeCellsReason.DoubleClick))
	{
		GridRangeInfo range = e.Columns; 
	this.grid.Model.ColWidths.ResizeToFit(range, 
                			GridResizeToFitOptions.IncludeHeaders);
		e.Cancel = true;
	}
}

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.

;