AlignControlsToGridColumns Property

Gets or sets a value which determines whether Newlook will automatically detect controls aligned to DataGrid columns.

App.ActiveForm.AlignControlsToColumns = [boolean]

Where boolean can be either True or False.

Client support

   Newlook Smartclient only.

Version Support

Introduced in Version 11.0.10.

Use

If a form's AlignControlsToGridColumns property is enabled, Newlook will search the form for any host fields that are present in the row directly above a detected subfile header and, provided the following criteria is met, automatically set the default AlignToGridColumn property of that field, to the name of the column it most closely aligns with. Detection criteria:

In the above scenario, Newlook will try to determine the correct column to assign as the AlignToGridColumn default, based on the position of the field/s relative to the position of the columns below. If multiple fields are aligned with the same column, then both controls will be positioned within the column's horizontal coordinates, but only the right-most control will re-size with the column.

Controls that have the AlignToGridColumn property set stay aligned and sized with the specified datagrid column, even when the grid column is re-sized at runtime.

Be AWARE:

It is important to note that turning this option on may cause controls to change position at runtime, in order to respect their column alignment. They may overlap other controls on the form if that control's AlignToGridColumn property is not also set. For this reason, it is always recommended that you test your solution after enabling this option to ensure there are no unintended side effects.

Global automatic detection of aligned grid columns

The AlignControlsToColumns property applies to an individual form, however it is possible to turn this option on for all forms in your application via the Automatic detection of aligned grid columns option in subfile rules. This property can then be used to turn automatic detection off for individual forms where desired.

See Also

Alignment property | AlignToGridColumn | Automatically detect controls aligned to grid columns option

Applies To

Form object


© 2004-2021 looksoftware. All rights reserved.