src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/ColumnHeader.cs
/// <summary>
///     Automatically resize a visible column to match the contents of the column.
///     Note that for proportional columns the full size of the contained text may
///     not be available, so this is not guaranteed to have no truncated text in the
///     column. This routine will not resize nonadjustable fixed-size columns, columns
///     hidden by the current column permutation.
/// </summary>
/// <param name="nativeColumn">The column to resize, using the native indexing ordering</param>
/// <returns>true if a column resize was attempted.</returns>
Automatically resize a visible column to match the contents of the column.
Note that for proportional columns the full size of the contained text may
not be available, so this is not guaranteed to have no truncated text in the
column. This routine will not resize nonadjustable fixed-size columns, columns
hidden by the current column permutation.
Automatically resize a visible column to match the contents of the column . Note that for proportional columns the full size of the contained text may not be available so this is not guaranteed to have no truncated text in the column . This routine will not resize nonadjustable fixed - size columns columns hidden by the current column permutation .
public bool AutoSizeColumn(int nativeColumn)
        {
            if (myHeaderBounds.HasHeaders)
            {
                var displayColumn = nativeColumn;
                if (myColumnPermutation != null)
                {
                    displayColumn = myColumnPermutation.GetPermutedColumn(nativeColumn);
                    if (displayColumn == -1)
                    {
                        return false;
                    }
                }
                var header = myHeaderBounds.Headers[displayColumn];
                if (header.IsColumnAdjustable)
                {
                    var fullWidth = ComputeColumnWidth(nativeColumn);
                    if (myHeaderBounds.RequestSetColumnWidth(this, displayColumn, fullWidth))
                    {
                        AfterHeaderSizeChanged();
                    }
                }
            }
            return false;
        }
public bool AutoSizeColumn ( int nativeColumn ) { if ( myHeaderBounds . HasHeaders ) { var displayColumn = nativeColumn ; if ( myColumnPermutation != null ) { displayColumn = myColumnPermutation . GetPermutedColumn ( nativeColumn ) ; if ( displayColumn == - 1 ) { return false ; } } var header = myHeaderBounds . Headers [ displayColumn ] ; if ( header . IsColumnAdjustable ) { var fullWidth = ComputeColumnWidth ( nativeColumn ) ; if ( myHeaderBounds . RequestSetColumnWidth ( this , displayColumn , fullWidth ) ) { AfterHeaderSizeChanged ( ) ; } } } return false ; }
Automatically resize a visible column to match the contents of the column.
Automatically resize a visible column to match the contents of the column .
// Check if the column is visible
true if a column resize was attempted.
true if a column resize was attempted .
nativeColumn
int
The column to resize, using the native indexing ordering
The column to resize using the native indexing ordering