This example allows users to add new items to the LookUpEdit and posts these items to the data source.
-
Use the LookUpEditBase.AddNewButtonPlacement property to display the Add New button.
-
When a user clicks this button or enters a value that does not exist in the data source, the
LookUpEditraises the ProcessNewValue event. -
Create an EventToCommand behavior and execute the
ShowProductFormcommand when theProcessNewValueevent is raised. -
In the
ShowProductFormcommand, use the DialogService to invoke a new item dialog. This dialog contains the DataLayoutControl that allows users to specify the item's properties. -
Add the specified item to the data source if the user clicks the Add button.
- MainWindow.xaml (VB: MainWindow.xaml)
- ViewModel.cs (VB: ViewModel.vb)
- Products.cs (VB: Products.vb)
- LookUpEdit
- LookUpEditBase.ProcessNewValue
- LookUpEditBase.AddNewButtonPlacement
- DialogService
- DataLayoutControl
- EventToCommand
- WPF LookUpEdit - Customize the Embedded Data Grid
- WPF LookUpEdit - Filter by Multiple Columns
- Use DialogService to Show a Modal Dialog Window
(you will be redirected to DevExpress.com to submit your response)

