AdjustWidthOnlyVisible: Boolean;
The AdjustWidthOnlyVisible property determines the mode of column width autofit.
Available values:
True. Autofit takes into account only width of elements currently displayed in the component. Width of elements available in the component by scrolling but not currently displayed is not taken into account.
False. Default value. Autofit takes into account width of all elements in the component.
To autofit the width, double-click the border between the columns or use the IDimensionViewer.AdjustWidth method.
Executing the example requires a form with a button named Button1 on the form, the DimensionTree component named DimensionTree1 and the UiDimension component that is a data source for DimensionTree1. A dictionary is connected to UiDimension.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
DimensionTree1.ShowColumnHeaders := True;
DimensionTree1.AdjustWidthOnlyVisible := True;
DimensionTree1.HighlightTrack := False;
DimensionTree1.ShowHeaderButton := True;
DimensionTree1.AdjustWidth(0);
DimensionTree1.UseSystemImages := True;
End Sub Button1OnClick;
Clicking the button displays column headers and a button that opens column headers menu in the DimensionTree1 component, width of the first column is autofitted considering only visible elements, elements highlighting on hover is disabled; standard icons are used.
See also: