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.

Grid resize is functioning sometimes and not others

Thread ID:





34560 Sep 12,2005 08:33 PM Sep 14,2005 06:32 AM Windows Forms 3
Tags: GridControl
Todd Armstrong
Asked On September 12, 2005 08:33 PM

I update the data source to my grid as follows: In windows designer code: this.gridDataBoundGrid.DataSource = this.dataViewGrid; In ReloadGridData() method: dataViewGrid.Table = gridPortfolioCounterPartyDataSet.PortfolioCounterparties; gridDataBoundGrid.Model.ColWidths.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders); This code works fine most of the time. However, during some times when it hits this code, I get a default column width for all columns and the text is wrapped. Why is that? Also, when I try to resize my columns manually, I get a red drag line and it doesn''t allow it. It goes back to original size and I can only double click the header line to auto size the column. Why is that? Thanks in advance for any info, Todd

Administrator [Syncfusion]
Replied On September 13, 2005 06:42 AM

Hi Todd, Try setting the AllowResizeToFit property to false . This prevents the GridDataBoundGrid from default resizing (getting adjusted according to Column Header Text). this.gridDataBoundGrid1.AllowResizeToFit=false; this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(0, this.gridDataBoundGrid1.Model.ColCount), GridResizeToFitOptions.IncludeHeaders); Here is a sample. autosizecolumn.zip Let us know if you need further help. Best Regards, Jeba.

Todd Armstrong
Replied On September 13, 2005 10:07 AM

AllowResizeToFit property is set to false in the Windows Designer code and is never changed. I resize grids all the time in my code and it usually works fine. It isn''t even resizing to the header size, but smaller, see attached. It would be great if there were a way to tell the grid to resize by the max of column header or cell data width with properties in the designer instead of having to do this through code. Any other ideas? >Hi Todd, > >Try setting the AllowResizeToFit property to false . This prevents the GridDataBoundGrid from default resizing (getting adjusted according to Column Header Text). > >this.gridDataBoundGrid1.AllowResizeToFit=false; >this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(0, this.gridDataBoundGrid1.Model.ColCount), GridResizeToFitOptions.IncludeHeaders); > >Here is a sample. >autosizecolumn.zip > >Let us know if you need further help. > >Best Regards, >Jeba. > grissize_4214.zip

Administrator [Syncfusion]
Replied On September 14, 2005 06:32 AM

Hi Todd, Currently there is no designer property. You have to call ResizeToFit programmatically at the end of Form load event handler. Best Regards, Jeba


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.