Can you use ScrollIntoView() with a PagedCollectionView in a Silverlight DataGrid?

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-01-30T23:39:32Z Indexed on 2010/03/16 20:11 UTC
Read the original article Hit count: 903

Is it possible to scroll to a particular row (by object identity) in a Silverlight DataGrid that has an ItemsSource which is a PagedCollectionView.

I am loading a list of orders that are grouped by day/status etc. I need to be able to scroll to a particular order.

 var pcv = new PagedCollectionView(e.Result.Orders);
 gridOrders.ItemsSource = pcv;

Unfortunately ScrollIntoView(order) doesn't work because of the PagedCollectionView.

An article on DataGrid from MSDN shows that it is possible to scroll to a group in a PagedCollectionView, but that's not really much use.

  foreach (CollectionViewGroup group in pcv.Groups)
  {
       dataGrid1.ScrollIntoView(group, null);
       dataGrid1.CollapseRowGroup(group, true);
  }

Is there a way to do this ?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about datagrid