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

Add Image To RadOutlookBarItem In Code Behind

1 Answer 47 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Kevin Marois
Top achievements
Rank 1
Kevin Marois asked on 15 Jan 2012, 08:54 PM
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

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 18 Jan 2012, 02:41 PM
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 >>

Tags
OutlookBar
Asked by
Kevin Marois
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or