/// <summary> /// 查询记录 /// </summary> private void BtnSearch_Click(object sender) { ObservableCollection <Jurisdiction> source = new JurisdictionBIZ().SelectAll(); var pagedSource = new QueryableCollectionView(source); View.DGSelect.ItemsSource = pagedSource; View.searchDataPager.Source = pagedSource; View.DGSelect.SelectedItems.Remove(View.DGSelect.SelectedItem);//取消首行选中 }
private void Loadcmb() { var collection = new JurisdictionBIZ().Select(""); if (collection.Count > 0) { View.cmbJurisdiction.ItemsSource = collection; View.cmbJurisdiction.DisplayMemberPath = "Name"; //DisplayMemberPath显示项 View.cmbJurisdiction.SelectedValuePath = "Code"; //SelectedValuePath绑值项 //view.cmbType.SelectedItem = view.cmbType.Items[0]; } else { UIHelper.ShowMessageBox("数据获取错误!", false); } }