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

Trying to add a treeview to an outlook bar in code

1 Answer 20 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 23 Apr 2010, 12:30 PM
Does anyone have ane example of to add a treeview to the outlookbar using code?  (not in the xaml?)

This does not seem to work:

public MainPage()
        {
            InitializeComponent();

            RadOutlookBarItem item = new RadOutlookBarItem();
            item.Header = "Documents";
            item.Content = "Documents";
            item.IsSelected = true;


            RadCalendar calendar = new RadCalendar();
            (obOutlookBar.SelectedItem as RadOutlookBarItem).Content = calendar;

          

        }

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 28 Apr 2010, 12:31 PM
Hello Tony,

You will have to use a Dispatcher for this particular scenario:

public MainPage()
{
    InitializeComponent();
    RadOutlookBarItem item = new RadOutlookBarItem();
    this.outlookBar1.Items.Add(item);
    item.Header = "Documents";
    item.Content = "Documents";
    item.IsSelected = true;
    RadCalendar calendar = new RadCalendar();
    Dispatcher.BeginInvoke(() =>
    {
        (this.outlookBar1.SelectedItem as RadOutlookBarItem).Content = calendar;
    });
}

The same goes for adding a TreeView instead of a Calendar. Give it a try and let me know how it works for you.

Kind regards,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
OutlookBar
Asked by
Tony
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or