LookUpColumnInfoCollection Class

A collection of columns for a lookup editor.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v21.1.dll

Declaration

[ListBindable(false)]
public class LookUpColumnInfoCollection :
    CollectionBase,
    IEnumerable<LookUpColumnInfo>,
    IEnumerable,
    IEqualityComparer<LookUpColumnInfo>

The following members accept/return LookUpColumnInfoCollection objects:

Remarks

The LookUpColumnInfoCollection class represents a collection of columns for a lookup editor. Each column is an instance of the LookUpColumnInfo class. See the RepositoryItemLookUpEdit.Columns property to access the editor’s column collection.

For each lookup column, you need to specify its field name via the LookUpColumnInfo.FieldName property. This represents a field whose values are displayed in the column.

A lookup editor allows you to create columns for all fields available in the RepositoryItemLookUpEditBase.DataSource. For this purpose, see the RepositoryItemLookUpEdit.PopulateColumns 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));

Inheritance

Object
CollectionBase
LookUpColumnInfoCollection
See Also