The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
ADAdministrator 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.
GHG. HurleyMay 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;