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

Image in Menu Icon is not displayed

6 Answers 164 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bichitra
Top achievements
Rank 1
Bichitra asked on 17 Sep 2008, 07:42 PM
Hi,

In your sample code in programming menu.

when I am runing the application the images are nt displayed.
the image path is given "

"../../Common/Images/RadMenu/11new.png"

;"

Can you help me.

Thanks
Bichitra

6 Answers, 1 is accepted

Sort by
0
NS
Top achievements
Rank 1
answered on 18 Sep 2008, 08:56 AM
I'm having the same problem in another project.
When referecing an icon in the radmenuitem I get the Exception (while running): Sys.Invalidoperationexception ImageError Error #4001 in control AG_E_NETWORK_ERROR
0
Hristo
Telerik team
answered on 18 Sep 2008, 10:19 AM
Hi there,

Image Uri is relative to the xap file location. To view the images in our QSF application you need to set index.html, which is located in the root of Telerik.Windows.Examples project, as a Starting Page (right mouse button click and Set as Start Page from the context menu).

If you have any other questions do not hesitate to contact us.

Best wishes,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
NS
Top achievements
Rank 1
answered on 18 Sep 2008, 11:28 AM
It still doesn't work on my custom project.
image is in a subfolder called images
This folder is available in the silverlight project and the web-project. (in which does it have to be strictly available ?)

If I place a regular image control on the usercontrol to display the image, it works fine.

The same image in the radmenuitem doesn't work.
0
Bichitra
Top achievements
Rank 1
answered on 18 Sep 2008, 12:13 PM
Hi,

Thanks for helping..  I mad sampleweb project as statup project and index.html as  start up . it is working fine.

I have few questions.  when application runs  "Telerik.Windows.Examples.zap is copied to ExamplesWeb folder . Is this zap folder is downloaded in browser?

2nd te Examples folder is copied to the "ExamplesWeb" with all source and image file, why? is it necssary source code should be copied to the web older.

3rd. if I want to create an image folder inside the webFolder and my zap file in the same web folder., how i can give the relative path to the menu to display the image.
I am waiting for your reply ..
Thanks
Bichitra
0
Hristo
Telerik team
answered on 18 Sep 2008, 04:37 PM
Hi Bichitra,

Straight to your questions:
  1. When you build the solution, Telerik.Windows.Examples.xap file gets copied to ExamplesWeb. This is because the index.html file looks for this xap file in the folder. When the application runs, the xap file is downloaded and saved in the browser's cache.
  2. The Examples folder is copied because these files are needed. When you click VIEW XAML or VIEW C# these files are shown.
  3. If your xap file is located in webFolder and your images are located in webFolder/Images then you can use the following XAML to reference the image:
    <UserControl  
            xmlns="http://schemas.microsoft.com/client/2007" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            x:Class="Telerik.Windows.Examples.Menu.ClickToOpen" 
            xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation">  
          
        <Grid> 
            <telerik:RadMenu VerticalAlignment="Top">  
                 <telerik:RadMenuItem Header="New">  
                      <telerik:RadMenuItem.Icon> 
                           <Image Source="Images/menuIcon.png"/>  
                       </telerik:RadMenuItem.Icon> 
                 </telerik:RadMenuItem> 
            </telerik:RadMenu> 
        </Grid> 
    </UserControl> 

Hope this helps.

Regards,

Hristo

the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bichitra
Top achievements
Rank 1
answered on 18 Sep 2008, 09:38 PM
Thanks For helping..

I fixed it..



Thanks
Bichitra
Tags
Menu
Asked by
Bichitra
Top achievements
Rank 1
Answers by
NS
Top achievements
Rank 1
Hristo
Telerik team
Bichitra
Top achievements
Rank 1
Share this question
or