wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase.md
Gets or sets the lookup editor’s (ComboBoxEdit, LookUpEdit) data source. This is a dependency property.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
[Bindable(true)]
public object ItemsSource { get; set; }
<Bindable(True)>
Public Property ItemsSource As Object
| Type | Description |
|---|---|
| Object |
An object that represents the data source from which the LookUpEdit retrieves its data.
|
The LookUpEdit editor cannot operate without a data source. The editor can be bound to any object that implements the IEnumerable interface or its descendant (e.g., IList , ICollection ).
When the ItemsSource property value changes, the ItemsSourceChanged event occurs.
The lookup editors support binding to data sources in Server Mode and Instant Feedback UI Mode.
To learn more, see Binding to Data Overview.
The following code snippets (auto-collected from DevExpress Examples) contain references to the ItemsSource property.
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.
wpf-data-grid-implement-crud-operations/CS/CodeBehind/EFCore/ServerMode/IssueDetailView.xaml#L12
<dxlc:LayoutItem Label="User">
<dxe:ComboBoxEdit EditValue="{Binding Item.UserId}" ItemsSource="{Binding EditOperationContext.Users}"
ValueMember="Id" DisplayMember="Name"
<dxe:ComboBoxEdit DisplayMember="Color"
ItemsSource="{Binding View.DataContext.ComboBoxItems}"
FilterCriteria="{Binding RowData.Row.FilterType, Converter={local:FilterConverter}}"
EditValue="{Binding Path=Address.State, Mode=TwoWay}"
ItemsSource="{dxe:EnumItemsSource EnumType={x:Type local:StateEnum},
AllowImages=False}"
wpf-use-devexpress-theme-in-applications/CS/DevExpress.Examples.ThemeSwitcher/MainWindow.xaml#L21
<dxe:ComboBoxEdit VerticalAlignment="Center" Width="200" ItemsSource="{Binding Source={x:Static dx:Theme.Themes}}" x:Name="cbTheme"
DisplayMember="Name" ValueMember="Name" EditValueChanged="cbTheme_EditValueChanged" />
EditValue="{DXBinding '@e(scheduler).AppointmentDragMode', UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{dxe:EnumItemsSource EnumType=dxsch:AppointmentDragResizeMode}" />
</dxlc:LayoutItem>
wpf-lookupedit-filter-by-multiple-columns/CS/MainWindow.xaml.cs#L9
InitializeComponent();
lookUpEdit.ItemsSource = new List<Item> {
new Item { ID = 012, ShortName = "UP", LongName = "United Package"},
wpf-data-grid-change-drop-down-filter-items/CS/DXGrid_CustomizingFilterDropdown/Window1.xaml.cs#L36
});
e.ComboBoxEdit.ItemsSource = filterItems;
}
wpf-data-grid-filter-column-lookupedit-based-on-value-in-another-column/CS/MainWindow.xaml.cs#L57
int countryId = (int)view.Grid.GetCellValue(e.RowHandle, "CountryId");
editor.ItemsSource = Cities.Where(city => city.CountryId == countryId).ToList();
}
wpf-richedit-document-encryption/CS/DXRichEdit_Encryption/MainWindow.xaml.cs#L36
string[] array = Enum.GetNames(typeof(EncryptionType));
encryptionComboBoxEdit.ItemsSource = array;
encryptionComboBoxEdit.SelectedItem = EncryptionType.Strong.ToString();
wpf-data-grid-change-drop-down-filter-items/VB/DXGrid_CustomizingFilterDropdown/Window1.xaml.vb#L24
filterItems.Add(New CustomComboBoxItem() With {.DisplayValue = "Registered in 2009", .EditValue = CriteriaOperator.Parse(String.Format("[RegistrationDate] >= #{0}# AND [RegistrationDate] < #{1}#", New DateTime(2009, 1, 1), New DateTime(2010, 1, 1)))})
e.ComboBoxEdit.ItemsSource = filterItems
End Sub
wpf-data-grid-filter-column-lookupedit-based-on-value-in-another-column/VB/MainWindow.xaml.vb#L80
Dim countryId As Integer = CInt(view.Grid.GetCellValue(e.RowHandle, "CountryId"))
editor.ItemsSource = Cities.Where(Function(city) city.CountryId = countryId).ToList()
End Sub
See Also