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 on header boundary to make column max width

Thread ID:





39349 Jan 4,2006 11:00 PM Jan 6,2006 12:08 PM Windows Forms 2
Tags: GridControl
Asked On January 4, 2006 11:00 PM

I am using a gridcontrol and was wondering of it could do the following: In Excel, if you double click on the right boundary of a column header, the column expands to fit the max width of the largest entry in that column. If you double click on the same column boundary again, it goes back to the default width it was before. Is this available by default in the grid or would you have any sample code which may do this?

Administrator [Syncfusion]
Replied On January 5, 2006 07:58 AM

Hi Va, you can try this code in ResizingColumns EventHandler int row,col; this.gridControl1.PointToRowCol(e.Point, out row, out col); if(e.Reason == Syncfusion.Windows.Forms.Grid.GridResizeCellsReason.DoubleClick) { if(this.gridControl1.DefaultColWidth == this.gridControl1.ColWidths[col]) { this.gridControl1.Model.ColWidths.ResizeToFit(e.Columns,GridResizeToFitOptions.ResizeCoveredCells); e.Cancel = true; } } Refer to Sample for more details Let me know if you need futher assistance. Regards, Madhan.


Replied On January 6, 2006 12:08 PM

This was great. thank you.


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.