AdjustWidthOnlyVisible: Boolean;
AdjustWidthOnlyVisible: boolean;
The AdjustWidthOnlyVisible property determines the mode of auto adjusting column width.
Available values:
True. Autofit takes into account only with of visible elements. Width of elements available with scrolling is ignored.
False. Default value. Autofit takes into account width of all elements.
To automatically adjust the width, double click the column between borders or use the IDimensionViewer.AdjustWidth method.
Executing the example requires a form with the button named Button1 on it, the DimensionTree component named DimensionTree1 and the UiDimension component which is a data source for DimensionTree1. Any 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, width of the first column is auto adjusted considering only visible elements, elements highlighting on hover is disabled; standard icons are used in the DimensionTree1 component.
The requirements and result of the Fore.NET example execution match with those in the Fore Example. Instead of the Fore components use Fore.NET analogs.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Begin
dimensionTreeNet1.CtrlBox.ShowColumnHeaders := True;
dimensionTreeNet1.CtrlBox.AdjustWidthOnlyVisible := True;
dimensionTreeNet1.CtrlBox.HighlightTrack := False;
dimensionTreeNet1.CtrlBox.ShowHeaderButton := True;
dimensionTreeNet1.CtrlBox.AdjustWidth(0);
dimensionTreeNet1.CtrlBox.UseSystemImages := True;
End Sub;
See also: