开发者

Lazy loading with wpf Data Grid

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜