Back to Devexpress

LookUpEditBase.ItemsSource Property

wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase.md

latest8.0 KB
Original Source

LookUpEditBase.ItemsSource Property

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

Declaration

csharp
[Bindable(true)]
public object ItemsSource { get; set; }
vb
<Bindable(True)>
Public Property ItemsSource As Object

Property Value

TypeDescription
Object

An object that represents the data source from which the LookUpEdit retrieves its data.

|

Remarks

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

xml
<dxlc:LayoutItem Label="User">
    <dxe:ComboBoxEdit EditValue="{Binding Item.UserId}" ItemsSource="{Binding EditOperationContext.Users}"
                      ValueMember="Id" DisplayMember="Name"

wpf-gridcontrol-populate-inplace-comboboxedit-with-values-based-on-values-from-other-cells/CS/MainWindow.xaml#L26

xml
<dxe:ComboBoxEdit DisplayMember="Color"
                  ItemsSource="{Binding View.DataContext.ComboBoxItems}"
                  FilterCriteria="{Binding RowData.Row.FilterType, Converter={local:FilterConverter}}"

wpf-synchronous-theme-preload-with-splashscreen/CS/ThemePreloadwithSplashscreen/ComplexWindow.xaml#L94

xml
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

xml
<dxe:ComboBoxEdit VerticalAlignment="Center" Width="200" ItemsSource="{Binding Source={x:Static dx:Theme.Themes}}" x:Name="cbTheme"
                  DisplayMember="Name" ValueMember="Name" EditValueChanged="cbTheme_EditValueChanged" />

wpf-scheduler-process-appointment-drag-drop-resize-operations/CS/SchedulerDragDropResizeExample/MainWindow.xaml#L29

xml
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

csharp
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

csharp
});
    e.ComboBoxEdit.ItemsSource = filterItems;
}

wpf-data-grid-filter-column-lookupedit-based-on-value-in-another-column/CS/MainWindow.xaml.cs#L57

csharp
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

csharp
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

vb
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

vb
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

ItemsSourceChanged

Binding to Data

LookUpEditBase Class

LookUpEditBase Members

DevExpress.Xpf.Editors Namespace