What's better to use: a DataGrid or ListView for displaying large amounts of data?

前端 未结 3 1127
醉酒成梦
醉酒成梦 2021-01-30 17:58

I want to display >50000 rows in a table. Which is the best control to use: a DataGrid or a ListView (in details view)? Which of these controls will have the better performance?

3条回答
  •  星月不相逢
    2021-01-30 18:26

    Don't. If you want to do something like this, load the first 500 rows and the last 100. When the user scrolls down a hundred rows, load the next batch automatically. On Ctrl+End, display the last 100 and preload the earlier batch in case the user scrolls up.

    Play with the numbers until you get something that feels smooth for the user without actually loading 50K rows

提交回复
热议问题