Skip to main content

LookUpColumnInfoCollection.Add(LookUpColumnInfo) Method

Adds a new column to the current collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.2.dll

Declaration

public virtual int Add(
    LookUpColumnInfo column
)

Parameters

Name Type Description
column LookUpColumnInfo

A column to add to the collection.

Returns

Type Description
Int32

The position into which the new element was inserted.

Remarks

Use the Add method to add a new element to the collection. The column to add is passed as the column parameter. To add several columns at once, see the LookUpColumnInfoCollection.AddRange method.

Example

The following code adds two columns to the RepositoryItemLookUpEdit.Columns collection of a lookup editor. For each column we initialize its field, caption and width.

using DevExpress.XtraEditors.Controls;
//...
lookUpEdit1.Properties.Columns.Add(new LookUpColumnInfo("ID", "No", 20));
lookUpEdit1.Properties.Columns.Add(new LookUpColumnInfo("Name", "Customer Name", 80));

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(LookUpColumnInfo) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also