DB
Daniel Byers
March 29, 2005 02:51 AM UTC
This apparently affects the ColWidths collection as well?? Is this because the grid is never actually drawn?
AD
Administrator
Syncfusion Team
March 29, 2005 09:35 AM UTC
Yes. The colwidths sizings are not set until the grid is displayed.
Likely calling grid.Refresh after the code you listed will make grid.Model.RowCount reflect the proper value, but it may not set the colwidths. If not, you can try explicitly calling:
grid.AllowResizeToFit = false;
grid.Model.ColWidths.ResizeToFit(GridrangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders);