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

Image on a RadRadioButton

2 Answers 97 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 21 Jul 2011, 10:58 PM
I'm trying to put an image on a RadRadioButton and am getting a warning when I build saying "The file 'Images/1Zone.png' is not part of the project or its 'Build Action' property is not set to 'Resource'".

I've checked the property, and it is set to Resource.  I've added the file and even checked it into TFS.  It is in the project.  I can modify the image source to point to another file in the folder and it displays.  It is a .jpg file, so I made a copy of my file as a .jpg and that didn't work.  I'm not sure at this point what I am doing wrong.  Anyone have any ideas?

My xaml code:

<telerik:RadRadioButton    Height="40" HorizontalAlignment="Left" Margin="6,29,0,0" Name="radioButton1" VerticalAlignment="Top"   Click="radioButton1_Click_1">
     <Image x:Name="btnImage1" Source="Images/1Zone.png" />
</telerik:RadRadioButton>

Attached is a screen shot of my Solution Explorer showing the file is there.

Thanks for any help

Lisa

2 Answers, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 26 Jul 2011, 12:36 PM
Hi Lisa,
I'll copy/paste here the answer that I gave you on your support thread:
"The problem is that the cdbChartPage user control in which you are using the images is not on the same hierarchy level as the Images folder - your folder hierarchy is like this:
- Images
- ViewModels
- Views
        - cdbChartPage
This means that the path to the images is not Images/1Zone.png but it is ../Images/1Zone.png so you should define your image like this:
Copy Code
<telerik:RadRadioButton Height="40" HorizontalAlignment="Left" Margin="6,29,0,0" Name="radioButton1" VerticalAlignment="Top" Click="radioButton1_Click_1">
<Image x:Name="btnImage1" Source="../Images/1Zone.png" />
</telerik:RadRadioButton>
I've attached your project without most of its code (and dlls) but with visible images so could you please examine it and if you have more questions feel free to ask."

Best wishes,
Zarko
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Lisa
Top achievements
Rank 1
answered on 26 Jul 2011, 02:54 PM
Thank you!  That works great in both the xaml and the code-behind.
Tags
Buttons
Asked by
Lisa
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Lisa
Top achievements
Rank 1
Share this question
or