Page view counter
DataGrid performance against ListBox
Last post 05-02-2008 5:16 AM by nmpgaspar. 2 replies.
Sort Posts:
05-01-2008 6:15 PM
DataGrid performance against ListBox

I have to list a bunch of itens, so i started using the ListBox.

After some preliminary experiences, when i tested with a real example, i noticed that filling the ListBox with 4000 lines, is really slow. Even closing my browser after filling it hangs my computer...

I just tested with a dataGrid now, and it's a lot faster.

But i would ratter use a ListBox than a datagrid... Anyone knows the reason for this behaviour?

Notice that my objects being displayed only have two fields, an integer and string.

nmpgaspar

Loading...
Joined on 03-03-2008
Posts 105
05-02-2008 4:17 AM
Marked as Answer
Re: DataGrid performance against ListBox

ListBox is not virtualized. It will create all the items when the binding occurs. DataGrid create content items when it needs it.
In WPF ListBox can be virtualized, I hope this feature will be present in future Silverlight releases ...

Thierry Bouquain
Ucaya
http://www.ucaya.com

thierry.bouquain

Loading...
Joined on 05-06-2007
Nantes, France
Posts 275
05-02-2008 5:16 AM
Re: DataGrid performance against ListBox

Hum, i see. Too bad then, i guess i will have to use the datagrid then.

Thank you.

nmpgaspar

Loading...
Joined on 03-03-2008
Posts 105
Microsoft Communities