Image in Menu Icon is not displayed

7 posts, 0 answers
  1. Bichitra
    Bichitra avatar
    34 posts
    Member since:
    Aug 2008

    Posted 17 Sep 2008 Link to this post

    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

  2. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 18 Sep 2008 Link to this post

    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
  3. DevCraft banner
  4. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 18 Sep 2008 Link to this post

    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.
  5. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 18 Sep 2008 Link to this post

    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.
  6. Bichitra
    Bichitra avatar
    34 posts
    Member since:
    Aug 2008

    Posted 18 Sep 2008 Link to this post

    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
  7. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 18 Sep 2008 Link to this post

    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.
  8. Bichitra
    Bichitra avatar
    34 posts
    Member since:
    Aug 2008

    Posted 18 Sep 2008 Link to this post

    Thanks For helping..

    I fixed it..



    Thanks
    Bichitra
Back to Top
DevCraft banner