在我加载一个位置的客户列表后,我想选择一个特定的客户作为当前项目。当我尝试移动到当前项目时,没有选择任何项目。我已经(通过调试)验证了我想要移动到的项目存在。
如果我移动到当前项目
(CustomerList.MoveCurrentTo(CustomerList.CurrentItem) //it works but is senseless.
CustomerList is an ICollectionView.
我的问题是“如何将当前项目焦点移动到我选择的特定项目?”。
CustomerList = new CollectionView ( _service.GetCustomers().Where(l => l.LocationID == customer.LocationID));
var item = CustomerList.Cast<AlarmPermit.Entities.Customer>().Where(l => l.BRKey == 52151).Single();
CustomerList.MoveCurrentTo(item);