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. Image for the cookie policy date

GridDataBoundGrid Column Widths

How do you alter column widths in a GridDataBoundGrid control? I've tried: grid.Model.ColWidths[x] = y; grid.Model.Cols.Size[x] = y; Neither work. I recall previously using the grid's TableStyles collection but can no longer find that property in a GridDataBoundGrid. Ideas? Thanks.

2 Replies

AD Administrator Syncfusion Team May 8, 2003 09:09 PM UTC

In addition to using the code above, also make sure you set grid.AllowResizeToFit = false. If this is true, the grid will try to autosize things based on header text which will undo your explicit sizing code.

GH G. Hurley May 9, 2003 02:15 PM UTC

Fixed. Thanks! btw: Both of these work now: grid.Model.ColWidths[x] = y; grid.Model.Cols.Size[x] = y;

Live Chat Icon For mobile
Up arrow icon