private void setCodeList() { try { List <CodeList> list = new CodeListDao().list(); unitCbb.DisplayMemberPath = "description"; unitCbb.SelectedValuePath = "code"; unitCbb.ItemsSource = list; } catch (Exception ex) { new AlertBox(ex.Message).ShowDialog(); } }
private void init() { try { List <ItemObj> itemList = new ItemDao().list(); itemNameCbb.DisplayMemberPath = "name"; itemNameCbb.SelectedValue = "id"; itemNameCbb.ItemsSource = itemList; List <CodeList> codeList = new CodeListDao().list(); unitCbb.DisplayMemberPath = "description"; unitCbb.SelectedValuePath = "code"; unitCbb.ItemsSource = codeList; } catch (Exception ex) { new AlertBox(ex.Message).ShowDialog(); } }