I've got a WPF DataGrid which I am populating from a DataTable. Up till now, I never had more than 200 or so records, so the DataGrid was populated flawlessly. However, I must now add support for larger databases. Thus, I thought of showing the user 200 records, and then allowing him to press a button of some sort, to display the next 200 and so on. This is so that I would load the DataGrid faster.
What would be the best approach for this? I have some experience with paging in ASP.NET, but I have never had a requirement like this in WPF.
This is my DataGrid code:
<DataGrid Name="dgResults"
IsReadOnly="True"
AutoGenerateColumns="True"
AllowDrop="False"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserSortColumns="False"
Margin="15,10,10,10"
Visibility="Collapsed"
ItemsSource="{Binding}"/>
Binding:
dgResults.DataContext = dtResults.AsDataView();