Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. public partial class MainWindow : Window
  2. {
  3.  
  4. public ObservableCollection<int> TableData
  5. {
  6. get
  7. {
  8. return _myTable;
  9. }
  10. }
  11.  
  12. ...
  13.  
  14. private void DG1_LoadingRow(object sender, DataGridRowEventArgs e)
  15. {
  16. if (_currentRow - RowBufferSize < e.Row.GetIndex())
  17. {
  18. AddPageToTable();
  19. }
  20. }
  21.  
  22. private bool AddPageToTable()
  23. {
  24. for (int i = 0; i < PageSize; i++)
  25. {
  26. _myTable.Add(_newDataEnumerator.Current);
  27. _newDataEnumerator.MoveNext();
  28. _currentRow++;
  29. }
  30. return true;
  31. }
  32. }
  33.  
  34. <DataGrid Name="DG1" ItemsSource="{Binding TableData}" AutoGenerateColumns="True" LoadingRow="DG1_LoadingRow">
  35. <DataGrid.Columns>
  36. <DataGridTextColumn Header="Data" Binding="{Binding}" Width="400"/>
  37. </DataGrid.Columns>
  38. </DataGrid>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement