VirtualizingWrapPanel in listbox

3 posts, 0 answers
  1. Shilpi
    Shilpi avatar
    18 posts
    Member since:
    Jan 2012

    Posted 23 May 2012 Link to this post

    Hi,

    My code is pretty simple -

    <

     

     

    ListBox x:Name="booksListBox" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" >

     

     

    <ListBox.ItemsPanel>

     

     

    <ItemsPanelTemplate>

     

     

    <telerik:VirtualizingWrapPanel ItemWidth="80"/>

     

     

    </ItemsPanelTemplate>

     

     

    </ListBox.ItemsPanel>

     

     

    <ListBox.ItemTemplate>

     

     

    <DataTemplate>

     

     

    <StackPanel Orientation="Vertical">

     

     

    <TextBlock Text="{Binding Author}" />

     

     

    <TextBlock Text="{Binding Name}" />

     

     

    </StackPanel>

     

     

    </DataTemplate>

     

     

    </ListBox.ItemTemplate>

     

     

    </ListBox>



    I get the following error - +  ExceptionObject {System.ArgumentException: Value does not fall within the expected range.} System.Exception {System.ArgumentException}

    I am not sure which VirtualizingWrapPanel Property needs to be setin order for this to work.

    Any help would be appreciated.
    Thanks, Shilpi
  2. Shilpi
    Shilpi avatar
    18 posts
    Member since:
    Jan 2012

    Posted 23 May 2012 Link to this post

    I was able to fix the error by setting MaxHeight and MaxWidth; but I am not sure what I should set that to.
  3. DevCraft banner
  4. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 24 May 2012 Link to this post

    Hi Shilpi,

    Can you attach a small project here with your code that exposes the issue. I was trying it here but with no success to expose the exception.

    Kind regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top