私のテーブルの詳細ビューの形のWPFフォーム上にデータソースがあります。特定の行を検索するときに、バインドされたテキストボックスで更新する必要がありますが、空白だけが表示されます。例えばWPFのデータセットへのビューの更新
System.Windows.Data.CollectionViewSource employeesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("employeesViewSource")));
Yello.YelloDataSet yelloDataSet = ((Yello.YelloDataSet)(this.FindResource("yelloDataSet")));
var adapter = new YelloDataSetTableAdapters.EmployeesTableAdapter();
var row = yelloDataSet.Employees.Select("ID='11'");
employeesViewSource.View.MoveCurrentTo(row);
私の場合は、操作を行います。
System.Windows.Data.CollectionViewSource employeesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("employeesViewSource")));
employeesViewSource.View.MoveCurrentToNext();
それはバインディングと完全と更新動作します。私は間違った機能を使っているのですか、何か不足していますか?
ありがとうございますが、employeesViewSourceにはselectメソッドがありません。見つけられないものです。 –
私は間違いをしました。 'Select'を使う前に' CollectionViewSource'をキャストしなければなりません。更新されたコード@MagnusWirström – Pikoh
これは私にこのエラーを与えます:CS0411 \tメソッド 'Enumerable.Select(IEnumerable 、Func )の型引数は、その使用から推論できません。型引数を明示的に指定してみてください。 –