Jaa


FormListControl.getColumn(Int32) Method

Definition

Retrieves a FormListColumn object for a specified column in a form list control.

public:
 virtual Dynamics::AX::Application::FormListColumn ^ getColumn(int _Idx);
public virtual Dynamics.AX.Application.FormListColumn getColumn (int _Idx);
abstract member getColumn : int -> Dynamics.AX.Application.FormListColumn
override this.getColumn : int -> Dynamics.AX.Application.FormListColumn
Public Overridable Function getColumn (_Idx As Integer) As FormListColumn

Parameters

_Idx
Int32

An Integer data type that specifies a column in a form list control.

Returns

A FormListColumn object for a specified column in a form list control.

Remarks

To display columns in a form list control, call the FormListControl.viewType method, and then pass the FormListViewType::Report enumeration value.

The following example shows a call to the getColumn method to return a FormListColumn object for the column in the form list control. The FormListControl.addColumn method adds the column to the form list control.

static void createForm2(Args _args) 
{ 
    Args args; 
    Form form; 
    FormRun formRun; 
    FormBuildDesign formBuildDesign; 
    FormBuildDataSource formBuildDataSource; 
    FormBuildListControl formBuildListControl; 
    FormListControl formListControl; 
    FormListItem formListItem; 
    FormListColumn formListColumn; 
    int idx4; 
    DictTable dictTable; 
    CustTable custTable; 
    str columnName; 
    // Create the form header. 
    form = new Form(); 
    // Add data sources to the form. 
    dictTable = new DictTable(tableNum(custTable)); 
    formBuildDataSource = form.addDataSource(dictTable.name()); 
    formBuildDataSource.table(dictTable.id()); 
    // Create the form design. 
    formBuildDesign = form.addDesign("Design"); 
    formBuildDesign.caption("myForm"); 
    // Add a form list control. 
    formBuildListControl = 
 formBuildDesign.addControl(FormControlType::ListView,"List"); 
    idx4 = formBuildListControl.id(); 
    args = new Args(); 
    args.object(form); 
    // Create the run-time form. 
    formRun = classfactory.formRunClass(args); 
    formRun.run(); 
    formRun.detach(); 
    formListControl = formRun.control(idx4); 
    formListControl.viewType(FormListViewType::Report); 
    formListControl.height(120); 
    formListControl.widthMode(FormWidth::ColumnWidth); 
    // Add a column to the form list control, 
    // and then set the column width. 
    formListControl.addColumn(1, new FormListColumn("Column1")); 
    formListColumn = formListControl.getColumn(0); 
    columnName = formListColumn.toString(); 
}

Applies to