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.

How to let column width to fit Column detail?

Thread ID:





6179 Aug 3,2003 06:54 PM Aug 4,2003 01:18 AM Windows Forms 1
Tags: GridControl
Asked On August 3, 2003 06:54 PM

I should set which Property?

Administrator [Syncfusion]
Replied On August 4, 2003 01:18 AM

If you are using a GridDataBoundGrid, the default behavior is to size columns based on the headertext. To turn off this default behavior so you can explicitly size the columns differently, you must set: this.grid.AllowResieToFit = false; Then to actually cause the column widths to rezie to to the text, you call this.grid.Model.Cols.ResizeToFit, passing in the range you want to resize, as well as options like whether to include the headers in teh resizing, or to allow the colsize to shrink. this.grid.Model.Cols.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders); will resize everything. Please note that is you have many, many rows, this may take some time, and you might want to just resize teh visible rows: Me.Grid.Model.RowHeights.ResizeToFit(GridRangeInfo.Rows(Me.GridDetail.TopRowIndex, Me.Grid.ViewLayout.LastVisibleRow), GridResizeToFitOptions.None)


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.