I have a CollectionViewSource that contains a set of indexed records extracted from an MS SQL Server Table called Example using Entity framework 6.2.
Example is declared as a DbSet property of my DbContext class viz:
public virtual DbSet<Example> Examples { get; set; }
My CollectionViewSource is:
CollectionViewSource exampleViewSource;
I can move around the collection and count the number of records it contains using the following for example:
int selectedRecordPosition = exampleViewSource.View.CurrentPosition;
exampleViewSource.View.MoveCurrentToPrevious();
int numberOfRecordsInCollectionView = exampleViewSource.View.SourceCollection.Cast<Example>().Count();
How can I find a particular record in the collection and set it as the record pointer's current location?
I'm looking for something like:
var selectedObject = exampleViewSource.View.SourceCollection.Find(key1, key2); // example pseudo code.
exampleViewSource.View.MoveCurrentTo(selectedObject);
key1 & key2 are the Primary access keys for the Example tables' rows.
Can anyone help please?
Exampleitem relate tokey1andkey2? - BionicCode