This is a migrated thread and some comments may be shown as answers.

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

5 Answers 89 Views
ListPicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Henrik Brinch
Top achievements
Rank 2
Henrik Brinch asked on 15 Apr 2012, 08:02 PM
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>


5 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 16 Apr 2012, 12:15 PM
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 >>

0
Henrik Brinch
Top achievements
Rank 2
answered on 16 Apr 2012, 06:32 PM
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 :(

0
Henrik Brinch
Top achievements
Rank 2
answered on 16 Apr 2012, 06:38 PM
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?!
0
Deyan
Telerik team
answered on 17 Apr 2012, 08:09 AM
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 >>

0
Martin
Top achievements
Rank 1
answered on 17 May 2012, 09:11 AM

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.

Tags
ListPicker
Asked by
Henrik Brinch
Top achievements
Rank 2
Answers by
Kiril Stanoev
Telerik team
Henrik Brinch
Top achievements
Rank 2
Deyan
Telerik team
Martin
Top achievements
Rank 1
Share this question
or