Monday, May 24, 2010

Silverlight Datagrid pager issues and PageCollectionView wrapper

Tried Datagrid pager by

<data:DataPager x:Name="TempDataGridPager"
               Source="{Binding Path=Source,ElementName=DataGrid1}"
                   PageSize="2" >
           </data:DataPager>

and then

DataGrid1.ItemsSource = ListPictures;

It did not work. Then looked at the following article

DataPager Class 

had to use PagedCollectionView, which provides paging functionality .to make it work

PagedCollectionView itemListView = new PagedCollectionView(ListPictures);
            TempDataGridPager.Source = itemListView;
               DataGrid1.ItemsSource = itemListView;

No comments:

Post a Comment