AD
Administrator
Syncfusion Team
July 26, 2004 07:24 AM UTC
If this is a GridDataBoundGrid, in formload, also set grid.AllowResizeToFit = false. The reason is that if this is not set, the grid will try to set the colwidths itself, and this can ''step on'' the explicit sizing you want to do.
Not that I think it will make a difference, but you do not have to use a new operator to generate a GridRangeInfo object as the class has Static constructors that simpleify things in this respect. This single line can replace all teh code you listed.
grid.Model.RowHeights.ResizeToFit(GridRangeInfo.Row(0), GridResizeToFitOptions.IncludeHeaders);