Trying to add a treeview to an outlook bar in code

2 posts, 0 answers
  1. Tony
    Tony avatar
    6 posts
    Member since:
    Sep 2008

    Posted 23 Apr 2010 Link to this post

    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;

              

            }

  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 28 Apr 2010 Link to this post

    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.
  3. DevCraft banner
Back to Top