Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class MainWindow : Window
- {
- public ObservableCollection<int> TableData
- {
- get
- {
- return _myTable;
- }
- }
- ...
- private void DG1_LoadingRow(object sender, DataGridRowEventArgs e)
- {
- if (_currentRow - RowBufferSize < e.Row.GetIndex())
- {
- AddPageToTable();
- }
- }
- private bool AddPageToTable()
- {
- for (int i = 0; i < PageSize; i++)
- {
- _myTable.Add(_newDataEnumerator.Current);
- _newDataEnumerator.MoveNext();
- _currentRow++;
- }
- return true;
- }
- }
- <DataGrid Name="DG1" ItemsSource="{Binding TableData}" AutoGenerateColumns="True" LoadingRow="DG1_LoadingRow">
- <DataGrid.Columns>
- <DataGridTextColumn Header="Data" Binding="{Binding}" Width="400"/>
- </DataGrid.Columns>
- </DataGrid>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement