A newer version of this page is available. Switch to the current version.

LookUpColumnInfoCollection.Add(LookUpColumnInfo) Method

Adds a new column to the current collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v19.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.

Examples

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));
See Also