Type | Description | |||
AlignmentEnum | An AlignmentEnum expression that indicates the item's alignment into the editor's drop-down list. |
Use the DropDownAlignment property to align the items in the editor's drop-down list. Use the Alignment property to align a column. Use the CellHAlignment property to align a cell. The property has effect only for the drop down type editors.
The following VB sample aligns the predefined items to the right ( the editor is assigned to the column ):
With G2antt1 .TreeColumnIndex = -1 With .Columns.Add("CheckList") .Alignment = RightAlignment With .Editor .EditType = CheckListType .DropDownAlignment = RightAlignment .AddItem &H1, "ReadOnly", 1 .AddItem &H2, "Hidden", 2 .AddItem &H4, "System", 3 .AddItem &H10, "Directory", 4 .AddItem &H20, "Archive", 5 .AddItem &H80, "Normal", 7 .AddItem &H100, "Temporary", 8 End With End With .Items.AddItem &H1 + &H2 End With
In the above sample, the TreeColumnIndex is set to -1, because the Alignment property is not applied for column that displays the hierarchy.
The following VB sample adds an editor that aligns its predefined items to the right:
With G2antt1.Items With .CellEditor(.FirstVisibleItem, 0) .DropDownAlignment = RightAlignment .EditType = DropDownListType .AddItem 0, "No border" .AddItem 1, "Single Border" .AddItem 2, "Double Border" End With End With
The following C++ sample adds an editor that aligns its predefined items to the right:
#include "Items.h" #include "Editor.h" COleVariant vtMissing; V_VT( &vtMissing) = VT_ERROR; CItems items = m_g2antt.GetItems(); CEditor editor = items.GetCellEditor( COleVariant( items.GetFirstVisibleItem() ), COleVariant( long(0) ) ); editor.SetEditType( 3 /*DropDownList*/ ); editor.SetDropDownAlignment( 2 /*RightAlignment*/ ); editor.AddItem( 0, "No border", vtMissing ); editor.AddItem( 1, "Single border", vtMissing ); editor.AddItem( 2, "Double border", vtMissing );
The following VB.NET sample adds an editor that aligns its predefined items to the right:
With AxG2antt1.Items With .CellEditor(.FirstVisibleItem, 0) .DropDownAlignment = EXG2ANTTLib.AlignmentEnum.RightAlignment .EditType = EXG2ANTTLib.EditTypeEnum.DropDownListType .AddItem(0, "No border") .AddItem(1, "Single Border") .AddItem(2, "Double Border") End With End With
The following C# sample adds an editor that aligns its predefined items to the right:
EXG2ANTTLib.Items items = axG2antt1.Items; EXG2ANTTLib.Editor editor = items.get_CellEditor(items.FirstVisibleItem, 0); editor.EditType = EXG2ANTTLib.EditTypeEnum.DropDownListType ; editor.DropDownAlignment = EXG2ANTTLib.AlignmentEnum.RightAlignment; editor.AddItem(0, "No border", null); editor.AddItem(1, "Single border", null); editor.AddItem(2, "Double border", null);
The following VFP sample adds an editor that aligns its predefined items to the right:
with thisform.G2antt1.Items With .CellEditor(.FirstVisibleItem, 0) .EditType = 3 && DropDownList .DropDownAlignment = 2 && RightAlignment .AddItem(0, "No border") .AddItem(1, "Single Border") .AddItem(2, "Double Border") EndWith endwith