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.
Hi
Is there any way to have the ResizeToFit methods on ColWidths and RowHeights take hidden rows/cols into account when calculating the sizes for the entire table?
Jimmy
ADAdministrator Syncfusion Team December 2, 2003 11:30 AM UTC
I don''t really have a good suggestion for this. If you do not have too many hidden rows/columns, then you could just try unhiding them, calling resize to fit, and then rehiding them. Here is some code that resizes the columsn taking into account text in hidden rows.
this.grid.BeginUpdate();
bool[] save = this.grid.Model.Rows.Hidden.GetRange(1, this.grid.Model.RowCount);
this.grid.Model.Rows.Hidden.ResetRange(1, this.grid.Model.RowCount);
this.grid.Model.ColWidths.ResizeToFit(GridRangeInfo.Table());
this.grid.Model.Rows.Hidden.SetRange(1, this.grid.Model.RowCount, save, true);
this.grid.EndUpdate();
this.grid.Refresh();