LookUpEdit Class
Represents a lookup editor.
Namespace: DevExpress.Xpf.Grid.LookUp
Assembly: DevExpress.Xpf.Grid.v18.2.dll
Declaration
Remarks
This a multi-column combo box that provides the lookup functionality using an embedded DXGrid control for WPF.
Its features include:
- Display and edit values can be taken from separate data fields specified by the LookUpEditBase.DisplayMember and LookUpEditBase.ValueMember properties, respectively.
- Multiple sort modes including auto-completion and incremental filtering (LookUpEditBase.AutoComplete, LookUpEditBase.IncrementalFiltering).
- Custom processing for entering not-in-list values. The LookUpEditBase.ProcessNewValue event can be handled to insert new records into the underlying data source (LookUpEditBase.ItemsSource).
- Embedded DXGrid Control.
- A nearly unlimited set of options to customize the dropdown list by exploiting the features provided by the DXGrid Control. These include customizable columns collection, data summaries, sorting, grouping and filtering dropdown list data by column values, and much more.
Lookup Editor can be used both as a standalone editor as well as an in-place editor within the DXGrid Control.
Example
This example shows how to customize the DXGrid Control displayed within the Lookup editor's popup window.Note: the embedded DXGrid name must be set to PART_GridControl.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/lookupedit-how-to-customize-the-embedded-grid-control-e2648.
<Window x:Class="HowToCreateLookUpEdit.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core">
<Grid>
<dxg:LookUpEdit Name="lookUpEdit1"
DisplayMember="ProductName"
ValueMember="ID"
AutoPopulateColumns="False"
AutoComplete="True"
IncrementalFiltering="True"
ImmediatePopup="True"
IsPopupAutoWidth="False"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="200" Margin="10">
<dxg:LookUpEdit.PopupContentTemplate>
<ControlTemplate>
<dxg:GridControl Name="PART_GridControl">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="ProductName" />
<dxg:GridColumn FieldName="UnitPrice" />
<dxg:GridColumn FieldName="Quantity" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True" />
</dxg:GridControl.View>
</dxg:GridControl>
</ControlTemplate>
</dxg:LookUpEdit.PopupContentTemplate>
</dxg:LookUpEdit>
</Grid>
</Window>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the LookUpEdit class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.