private int GetAutoColumnWidth(int column)
{
RowCollection rows = this.TableModel.Rows;
int maxwidth = 0;
Column c = this.ColumnModel.Columns[column];
if (this.includeHeaderInAutoWidth)
{
maxwidth = c.ContentWidth;
}
for (int i = 0; i < rows.Count; i++)
{
// Don't count this row if it is currently a hidden subrow
Row row = rows[i];
if ((row.Parent == null || row.Parent.ExpandSubRows) && (row.Cells.Count > column))
{
int w = row.Cells[column].ContentWidth;
if (w > maxwidth)
maxwidth = w;
}
}
int changedMax = GetAutoColumnWidthWithMode(c, maxwidth);
return changedMax;
}