This example shows how to create and configure an in-place LookUpEdit control (RepositoryItemLookUpEdit
) for editing cells in a grid column.
The lookup editor is used to edit the CategoryID field values from the Products
list. The lookup editor displays corresponding category names in the edit box.
Use the following properties to bind the LookUpEdit control to data:
- DataSource - Specifies the source of records.
- DisplayMember - The data source field whose values are visible to users. A value from this field is displayed in the lookup’s text box when a user selects a record.
- ValueMember - The data source field with unique/key values. A value from this data field is assigned to the lookup's
EditValue
property when a user selects a record. When a lookup editor is used to edit cell values in the Data Grid, the type of theValueMember
field must match the type of the field assigned to the grid's lookup column (GridColumn.FieldName). Enable the lookup's ThrowExceptionOnInvalidLookUpEditValueType option to detect data type issues.
- Form1.cs (VB: Form1.vb)
- Program.cs (VB: Program.vb)
(you will be redirected to DevExpress.com to submit your response)