Skip to main content

LookUpColumnInfo(String, String, Int32) Constructor

Creates an instance of the LookUpColumnInfo class and initializes its field name, caption and width.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public LookUpColumnInfo(
    string fieldName,
    string caption,
    int width
)

Parameters

Name Type Description
fieldName String

The value to initialize the LookUpColumnInfo.FieldName property.

caption String

The value to initialize the LookUpColumnInfo.Caption property.

width Int32

The value to initialize the LookUpColumnInfo.Width property.

Remarks

The constructor creates a column and initializes its field name, caption and width with the values specified.

Other properties are set as follows:

After a column has been created, you can add it to a lookup editor’s column collection by using the LookUpColumnInfoCollection.Add method, for instance. To access the column collection, see the RepositoryItemLookUpEdit.Columns property.

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