custom virtualizing wrap panel for winrt-xaml

0

i'm trying to create search feature in my apps, but when the search result is producing more than 1000 row, an error show up which say :

Exception   {"Not enough quota is available to process this command. (Exception from HRESULT: 0x80070718)"} System.Exception

i know this is caused by the system is trying to make a LOT of change in the UI and it's way too much so the system terminated it, because it will takes a long time to complete that request..

and i am well aware of that because i'm using a custom wrapPanel control that measure every item height and create the block in the UI and when i use virtualizing control like wrapgrid or virtualizingstackpanel, no error show up..

so, what i'm trying to accomplish is, is it possible to create a custom control like wrap panel but virtualize the data so that error won't show up anymore.. if it could, how we do that? with incrementaldataloading or what?

sorry i'm new in winrt-xaml,and i'm trying to figure out what is it :)

UPDATE :

this is links where i get the WrapPanel.cs and this is my XAML code looks like :

    <GridView x:Name="gvResult">
        <GridView.ItemsPanel>
            <ItemsPanelTemplate>
                <local:WrapPanel
                    Orientation="Vertical"/>
            </ItemsPanelTemplate>
        </GridView.ItemsPanel>
        <GridView.ItemTemplate>
            <DataTemplate>
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="300" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Width="300" TextWrapping="Wrap">
                        <Underline>
                            <Run FontWeight="Medium" Text="{Binding abbKitab}"/><Run Text=" "/><Run FontWeight="Medium" Text="{Binding numBab}"/>
                            <Run FontWeight="Medium" Text=":"/> <Run FontWeight="Medium" Text="{Binding numAyat}"/>
                        </Underline>
                        <LineBreak/>
                        <Run Text="{Binding isi}"/>
                    </TextBlock>
                </Grid>
            </DataTemplate>
        </GridView.ItemTemplate>
    </GridView>
c#
windows-8
windows-runtime
winrt-xaml
virtualization
asked on Stack Overflow May 18, 2013 by Alvin Setiawan • edited May 20, 2013 by Alvin Setiawan

1 Answer

0

Perhaps if you derived your WrapPanel from OrientedVirtualizingPanel it would work, but I wouldn't bet on it being possible. You could create your own list control with custom virtualization implementation, but that seems to be even harder. Maybe give up on your custom panel and just use a WrapGrid or group your results in a virtualizing panel e.g. have specific sized pages that represent groups of results each with a specific number of items in a WrapPanel? Then you could offload the virtualization to the outer panel and have each group styled with your custom one.

answered on Stack Overflow May 19, 2013 by Filip Skakun

User contributions licensed under CC BY-SA 3.0