Images in listpicker popup template are not loaded (except for the initial item)

6 posts, 0 answers
  1. Henrik Brinch
    Henrik Brinch avatar
    100 posts
    Member since:
    Aug 2004

    Posted 15 Apr 2012 Link to this post

    I have a listpicker that I want to show an Image along with a text.

    At first, it seems to work (the item displayes the image and text) but when opening the list popup it only shows the image for the original item.   Choosing another item and re-opening the popup, the image is now shown for the first and the second item.

    I want the images to be loaded and shown for all items in my listpicker.

    The XAML for my list picker is:

    <telerikInput:RadListPicker Grid.Row="0" Grid.Column="1" Name="pickerFrom" VerticalAlignment="Center" PopupHeader="Currency">

    <telerikInput:RadListPicker.PopupItemTemplate>

     

    <DataTemplate>

     

        <StackPanel Orientation="Horizontal" Margin="4">

            <Image Source="{Binding Image}" Width="64" Height="64" Margin="0,4,12,4"/>
            
    <TextBlock FontSize="{StaticResource PhoneFontSizeExtraLarge}" FontFamily="{StaticResource PhoneFontFamilyLight}" Text="{Binding Name}" VerticalAlignment="Center" FontWeight="Bold" Foreground="White" />
        </StackPanel>

    </DataTemplate>
    </telerikInput:RadListPicker.PopupItemTemplate>

    <telerikInput:RadListPicker.ItemTemplate>

    <DataTemplate>

    <StackPanel Orientation="Horizontal" Margin="4">

        <Image Source="{Binding Image}" Width="64" Height="64" Margin="0,4,12,4"/>

        <TextBlock FontSize="{StaticResource PhoneFontSizeLarge}" FontFamily="{StaticResource PhoneFontFamilyLight}" Text="{Binding Name}" VerticalAlignment="Center" FontWeight="Bold" Foreground="White" />

        </StackPanel>

    </DataTemplate>

    </telerikInput:RadListPicker.ItemTemplate>

     

     

    </telerikInput:RadListPicker>


  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 16 Apr 2012 Link to this post

    Hi Henrik,

     Thank you for contacting us. We are not aware of such an existing issue. Could you please take a look at the attached project and let me know if I am missing anything. I'd be glad to further assist you.

    All the best,
    Kiril Stanoev
    the Telerik team

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

  3. DevCraft banner
  4. Henrik Brinch
    Henrik Brinch avatar
    100 posts
    Member since:
    Aug 2004

    Posted 16 Apr 2012 Link to this post

    Thanks for your sample.

    I'm deeply mystified!   Your sample works perfectly.

    Then I tried narrowing down the problem - but without any luck.  I've changed the sample to look exactly as the page in my application.  However my application, keeps having the original problem whereas your sample works.  So now I have to identical xaml pages with identical codebehind - but with diffent results.   I've even tried deploying my app to my phone, but still with the same result :(

    The only difference left, is that my application has a LOT of content files (though not in the same image folder) - but that is the only difference left.

    I can't narrow the problem down further - and unfortunately I can't publish the whole project here (as it is commercial).

    So as for now, I've had to go another way - creating a page with a RadDataBoundListBox on its own page - binding to the same datasource and the same template - it works perfeclty.   So my conclusion:   The RadPicker has somekind of problem and I can't narrow the problem down further :(

  5. Henrik Brinch
    Henrik Brinch avatar
    100 posts
    Member since:
    Aug 2004

    Posted 16 Apr 2012 Link to this post

    Going further ... to emulate the RadPicker, I now tried to create a RadWindow and place the working RadDataBoundListBox in that ... and now I got exactly the same result!  Missing images ...  but the RadDataBoundListBox works perfectly on its own page?!
  6. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 17 Apr 2012 Link to this post

    Hi Henrik,

    The problem here is related to the way RadWindow (used in RadListPicker) works.

    Normally, when you reference resources by Uri you describe the relative path according to the current position of the page where your control resides. Since, however, RadWindow inserts its popup in the root page of the whole application, the path of the Uri resource should be considered starting relatively to the root page of the application.

    Can you try updating your URIs in this way and let me know if this works?

    All the best,
    Deyan
    the Telerik team

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

  7. Martin
    Martin avatar
    8 posts
    Member since:
    Oct 2011

    Posted 17 May 2012 Link to this post

    I got similar problem - I have RadListPicker -> PopupItemTemplate template -> there is a button with custom style with an Image

    It's not shown no matter what Image Uri I use - relative, with/without assembly prefix.

    This is currently show stopper for us - we're creating listpicker with "play preview" button in the full screen mode. In WP7 toolkit this works, in RadListPicker it's not working.

    Edit: solved it, had to use relative url like "Images/appbar.play.png". I used uris starting with slash before and it worked.

Back to Top
DevCraft banner