Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > OutlookBar > Add Image To RadOutlookBarItem In Code Behind

Not answered Add Image To RadOutlookBarItem In Code Behind

Feed from this thread
  • Posted on Jan 15, 2012 (permalink)

    I am trying to set up RadOutlookBarItems in the code behind. I want to add an icon to each section so far I have this:

    private void addOutlookBarSections()
    {
        Sections = new ObservableCollection<RadOutlookBarItem>();

        
    RadOutlookBarItem projects = new RadOutlookBarItem();
        projects.Header = "Projects";
        BitmapImage projectsIcon = new BitmapImage(new Uri("media/images/project_24.png", UriKind.Relative));
        projects.Icon = projectsIcon;
        Sections.Add(projects);
      
        RadOutlookBarItem clients = new RadOutlookBarItem();
        clients.Header = "Clients";
        BitmapImage clientsIcon = new BitmapImage(new Uri("media/images/person_24.png", UriKind.Relative));
        clients.Icon = clientsIcon;
        Sections.Add(clients);
      
    }


    It runs and the sections are there, but the icons are not. The icons are included in the project, What's the right way to do this?

    Thanks

    Reply

  • Tina Stancheva Tina Stancheva admin's avatar

    Posted on Jan 18, 2012 (permalink)

    Hello Kevin,

    I am not sure how you're using the Sections collection to populate the RadOutlookBar with items and this is why I attached a sample project where I used your code snippet to populate directly the RadOutlookBar.Items collection and it works as expected on our side. Can you please give it a try and let me know if it works for you or if I'm missing something from your approach

    Kind regards,
    Tina Stancheva
    the Telerik team

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > OutlookBar > Add Image To RadOutlookBarItem In Code Behind