AlignToGridColumn Property

Gets or sets the grid column that this control is aligned to. Design-time only. Not available at run-time.

object.AlignToGridColumn = [column]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and column can be any grid column that exists on the current form.

Client support

   Newlook Smartclient only.

Version Support

Introduced in Version 11.0.9.

Use

The AlignToGridColumn property was introduced to provide a mechanism for fields outside the datagrid to stay aligned and sized with a specified datagrid column, even when the grid column is re-sized at runtime. This is particularly relevant if you have a subfile 'filter' field, which is used to search the contents of your subfile, or an output field which relates to the contents of a subfile column, like a 'total' field. This property can be set at design-time to the name of any grid column on the current form.

Be AWARE:

It is important to note that once you set this property in Designer, its position may change at runtime. This may cause the control to overlap other controls on the form if their AlignToGridColumn property is not also set.

Automatic detection of aligned grid columns

Typically this property defaults to a blank value and must be manually set in Designer. However, if the Automatically detect controls aligned to grid columns option has been enabled in subfile rules, or the AlignControlsToGridColumns property has been enabled on the form, Newlook will search for any host fields that are present in the row directly above a detected subfile header and, provided the following criteria is met, will set their default AlignToGridColumn property to the name of the column that the field is most closely aligned to:

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.

It is always recommended that you test your solution after enabling this option to ensure that the correct columns have been assigned to this property.

See Also

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

Applies To

Check box control

Combo box control

Date combo box control

Label control

Menu button control

Option button control

Picture box control

Text box control

Up down control


© 2004-2021 looksoftware. All rights reserved.