Vladimir Li
Vladimir Li

Reputation: 151

Silverlight 4 nested ListBox controls performance issue

I am working on a silverlight page that will have a horizontal list box that will contain a list of "cards". Each "card" contains a vertical list box with some text in it. However, I am running into a lot of performance issues. Has anyone experienced any performance issues with nested listboxes in the past?

Upvotes: 1

Views: 390

Answers (2)

gius
gius

Reputation: 9437

UI Virtualization might help you. Try to use VirtualizingStackPanel (instead of StackPanel) as the ItemsPanel of your Listbox:

<ListBox>
    ...
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

Upvotes: 0

Thanigainathan
Thanigainathan

Reputation: 1547

If its a DataGrid then Paging can give good performance. If its ListBox then we should keep an eye on the count of data binded with listbox.

Are you trying to bind the full list on single shot from server ? Then this will definitely affect the performance.

Upvotes: 1

Related Questions