Sweta Sinha

Sweta Sinha

  • NA
  • 51
  • 40.6k

Expnader View Crashing in WP8

Mar 16 2015 3:26 AM
Hi,


I have created an expander view in my app.I have around 5k subitems for a header.The app gets crashed when the header is expanded.To just verify this, I have tried to display 500 subitems,it worked but took time to get expanded.Kindly help me if I can display 5K records with the help of expander view without taking time.My code is:


<Grid Margin="0,115,0,83"  >
                <ListBox x:Name="orderList" Margin="0,5,0,5"  >
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        </Style>
                    </ListBox.ItemContainerStyle>
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                <toolkit:ExpanderView  Header="{Binding}"   Expander="{Binding}" ItemsSource="{Binding itemList}"  NonExpandableHeader="{Binding}" 
                IsNonExpandable="{Binding HasNoOptions}" IsExpanded="{Binding IsExpanded, Mode=TwoWay}" HeaderTemplate="{StaticResource CustomHeaderTemplate}" ExpanderTemplate="{StaticResource CustomExpanderTemplate}" 
                ItemTemplate="{StaticResource CustomItemTemplate}" NonExpandableHeaderTemplate="{StaticResource CustomNonExpandableHeaderTemplate}" Style="{StaticResource ExpanderViewStyle1}" />
                          </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>


 this.orderList.ItemsSource = myList;