-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.cs
24 lines (21 loc) · 1.07 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
using DevExpress.XtraEditors;
namespace DXApplication1 {
public partial class Main : DevExpress.XtraEditors.XtraForm {
public Main() {
InitializeComponent();
lookUpEdit1.Properties.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
SetupLookUpEditor(gridLookUpEdit1, DataProvider.GetCategoryList(), "ID", "CategoryName");
SetupLookUpEditor(lookUpEdit1, DataProvider.GetProductList(), "ID", "ProductName", gridLookUpEdit1);
SetupLookUpEditor(searchLookUpEdit1, DataProvider.GetOrderList(), "ID", "OrderNumber", lookUpEdit1);
}
private void SetupLookUpEditor(LookUpEditBase lookup, object dataSource, string valueMember, string displayMember, LookUpEditBase lookupOwner = null) {
lookup.Properties.DataSource = dataSource;
lookup.Properties.ValueMember = valueMember;
lookup.Properties.DisplayMember = displayMember;
lookup.CascadingOwner = lookupOwner;
}
}
}