ObservableCollection as I've seen suggested to be used in another post.
This is my Code
Document
currentRec = (Document)gvMainWorkQueue.SelectedItem;
gvMainWorkQueue.ItemsSource = Progressive.Document.
DataLayer.GetUnprocessedDocuments(userDepartment, userRole);
try
{
if (currentRec != null)
{
for (int x = 0; x < gvMainWorkQueue.Items.Count; x++)
{
if ((gvMainWorkQueue.Items[x] as Document).DocumentId == currentRec.DocumentId)
{
gvMainWorkQueue.SelectedItem = gvMainWorkQueue.Items[x];
if (gvMainWorkQueue.SelectedItem != null)
{
gvMainWorkQueue.ScrollIntoView(gvMainWorkQueue.SelectedItem);
}
break;
}
}
}
}
catch (System.Exception ex)
{
}