开发者

Silverlight datagrid load all rows

开发者 https://www.devze.com 2023-03-14 15:00 出处:网络
The Silverlight datagrid seems to load rows (firing off the LoadingRow event) while I scroll up and down.

The Silverlight datagrid seems to load rows (firing off the LoadingRow event) while I scroll up and down.

Is there a wa开发者_运维百科y to prevent this behavior? I would like to load all rows at once when I set the datagrid's ItemSource.

Is this possible?


Most likely happening because SL datagrid uses virtualization for performance optimization. You can read more here, but it appears the solution is to add this to your DG declaration:

VirtualizingStackPanel.VirtualizationMode="Standard"  


There is a good reason it does this. A datagrid in Silverlight automatically resizes itself. Only loading part of the data source does increase performance. Is is rather big deal if you have a lot of row, that is a lot of work for your GPU.

0

精彩评论

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