开发者

Lazy loading with wpf Data Grid

开发者 https://www.devze.com 2023-01-20 05:40 出处:网络
Initially I am populating 100 rows in Data grid, when user scroll the grid rows, I want to populate another 100 rows. I am using wpf data grid, I have not found any event of data grid that I can catch

Initially I am populating 100 rows in Data grid, when user scroll the grid rows, I want to populate another 100 rows. I am using wpf data grid, I have not found any event of data grid that I can catch to accomplish this task. Then I have used scroll viewer control and try to catch change event where I know that my scroll viewer reach at end, then I will load another rows in data grid.

 <ScrollViewer Name="svDataGrid" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" ScrollChanged="ScrollViewer_ScrollChanged" >
            <DataGrid VerticalScrollBarVisibility="Disabled"   Background="Transparent" Visibility="Coll开发者_JAVA技巧apsed" Name="dgList" Grid.Row="1" IsSynchronizedWithCurrentItem="True"
                 AutoGenerateColumns="False" AlternatingRowBackground="Azure"
                 CanUserAddRows="False" CanUserDeleteRows="False"
                 CanUserSortColumns="True" CanUserReorderColumns="False"
                 CanUserResizeColumns="True" CanUserResizeRows="False" IsReadOnly="True" MouseDoubleClick="dgList_MouseDoubleClick"  PreviewKeyDown="dgList_PreviewKeyDown">
            </DataGrid>
        </ScrollViewer>

any suggestion or hint appreciated.

Thanks


You should be looking at data virtulization.

Please refer http://bea.stollnitz.com/blog/?p=344

0

精彩评论

暂无评论...
验证码 换一张
取 消