DataGrid Paging in Silverlight 3

Hello All,


A small example of Datagrid using DataPager control.


Xaml code:


<Data:DataGrid x:Name="myDatagrid" />
<Data:DataPager x:Name="myPager" Source="{Binding Path=ItemsSource, ElementName=myDatagrid}" PageSize="5" />


Code Behind:


using System.Window.Data;


namespace DataGridControls
{
           public partial class DatagridPaging : UserControl
         {
                       InitializeComponent();
                       PagedCollectionView  pagedcollectionview = new PagedCollectionView("H E L L O W O R L D".Split(' '));
                       myDatagrid.ItemsSource = pagedcollectionview;
         }
}


Hope that helps.


Comments are always welcome. Thank you.

3 comments:

  1. Thanks, article is good to get up and running in within few mins.

    ReplyDelete
  2. Thankyou it really help me please tell me about how to filter in datagrid silverlight

    ReplyDelete