Display image inside VirtualizingWrapPanel

2 posts, 0 answers
  1. Alan
    Alan avatar
    2 posts
    Member since:
    Jun 2012

    Posted 10 Jun 2012 Link to this post

    i want to display image in each item on VirtualizaingWrapPanel.
    I try to modify the sample code VirtualizingWrapPanel.WPF Example.xml
    by adding a line (bold below) to show a image

    < DataTemplate x:Key="dataTemplate">
    < TextBlock FontWeight="Bold" Text="Discontinued:" Grid.Row="4"/>
    <TextBlock Text="{Binding Discontinued}" Grid.Row="4" Grid.Column="1" />

    <TextBlock FontWeight="Bold" Text="Image:" Grid.Row="5"/>
    <Image Source="{Binding Image}" Grid.Row="5" Grid.Column="1" />

    the Image is a property with BitmapImage Type.
    After recomplie the sample and i can see the image shown.
    However,when i resize the sample window.the app seems hang.
    I would like to known the properly way to display a image in VirtualizingWrapPanel?

  2. Vlad
    Vlad avatar
    11100 posts

    Posted 11 Jun 2012 Link to this post


    As far as we know there is nothing special in this case and your code should work normally if the image (and binding) is valid. Please make sure also that you have enough space for the image (ItemHeight/ItemWidth settings for the panel). 

    Kind regards,
    the Telerik team

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

Back to Top