RepositoryItemLookUpEdit Class
Contains settings specific to a lookup editor.
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v21.2.dll
NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Navigation
Declaration
[RepositoryItemLookUpEditBase.LookupEditCustomBindingProperties("LookUpEdit")]
public class RepositoryItemLookUpEdit :
RepositoryItemLookUpEditBase,
IDataInfo
Related API Members
The following members return RepositoryItemLookUpEdit objects:
Remarks
The RepositoryItemLookUpEdit class specifies settings specific to a LookUpEdit control. You can access these settings via the editor’s LookUpEdit.Properties object.
The repository item provides properties, methods and events to customize the editor’s behavior and appearance. For instance, you can specify:
- source of dropdown rows (RepositoryItemLookUpEditBase.DataSource)
- field whose data is displayed in the edit box (RepositoryItemLookUpEditBase.DisplayMember)
- field which matches the edit value (RepositoryItemLookUpEditBase.ValueMember)
- collection of columns to display in the dropdown (RepositoryItemLookUpEdit.Columns)
- width of the dropdown window (RepositoryItemLookUpEdit.PopupWidth), etc.
The RepositoryItemLookUpEdit.PopulateColumns method allows you create columns for available fields in the RepositoryItemLookUpEditBase.DataSource. To modify their width, you can call the RepositoryItemLookUpEdit.BestFit method.
You should create repository items as standalone objects only to specify inplace editors for container controls (such as the XtraGrid).
Dictionary as a Data Source
If you use a Dictionary<TKey,TValue> as a data source for a lookup editor, the editor uses keys and values as follows:
- the TKey values — as actual values. These values are assigned to the editor when a user selects an item in the drop-down box.
- the TValue values — as string representations of the actual values. These strings are displayed in the edit box and drop-down window.
There is no need to specify the ValueMember and DisplayMember properties.
Note
The TKey and TValue parameters should be of the String type or a value type. For example, keys are integers and values are strings.
See the following topic for more information: Dictionary as a Data Source for a Lookup Editor.