R – Listbox perfomance issue with huge data in Silverlight 2

silverlightsilverlight-2.0

Iam using Silverlight 2 in which I have a perfomance issue when I use a Listbox control. I am binding a List of objects of about 500 records which is taking 3-4 seconds for databinding.

But Iam not having this issue with DataGrid.

Does anyone have a answer for improving the perfomance issue in Listbox?

Best Answer

The reason behind this is that the DataGrid supports UI Virtualization and the ListBox does not. This means that the DataGrid only creates visual elements for the visible items while the ListBox creates visual elements for all of its items. Whenever you have to select from a list of items that can be very large, use the DataGrid instead of the ListBox. You can style the DataGrid and use the TemplateColumn to make it look just like a ListBox.

Michael

Related Topic