Add items programatically

4 posts, 0 answers
  1. Mário
    Mário avatar
    4 posts
    Member since:
    Jun 2012

    Posted 27 Apr 2015 Link to this post

    Good afternoon, Telerik Team!

    I have a question, how would I add items in a outlook bar programmatically

    Example:

    I have a Rad Outlook Bar in a WPF grid without items, in another moment,  I need programmatically include I items 1,2,3  sequentially one by one

    including headers too in it

    Is this possible?

     

    Att

  2. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 28 Apr 2015 Link to this post

    Hi Att,

    You can add RadOutlookBarItems programmatically in the Items collection of the RadOutlookBar control.
    for (int i = 0; i < 3; i++)
    {
        RadOutlookBarItem outlookBarItem = new RadOutlookBarItem();
        outlookBarItem.Header = "Item " + i;
        this.outlookBar.Items.Add(outlookBarItem);
    }
    If you your scenario includes data binding you can see the Data Binding help article.

    Please let me know if you need any further assistance.

    Regards,
    Martin
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mário
    Mário avatar
    4 posts
    Member since:
    Jun 2012

    Posted 05 May 2015 in reply to Martin Link to this post

    Thank you telerik Team! Always helpful  

    I need a help more

    This tip has helped me a lot, but I need insert in this new item a radgridview and interact with it, is this possíble programmatically?

     

     

  5. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 06 May 2015 Link to this post

    Hi,

    You can add any UIElement including RadGridView in the content of the RadOutlookBarItems. Here is an example:
    for (int i = 0; i < 3; i++)
    {
        RadOutlookBarItem outlookBarItem = new RadOutlookBarItem();
         
        // sample definition of a RadGridView control in code
        RadGridView gridView = new RadGridView();
        gridView.ItemsSource = GenerateItems();
         
        outlookBarItem.Content = gridView;
        outlookBarItem.Header = "Item " + i;
        this.outlookBar.Items.Add(outlookBarItem);
    }


    Regards,
    Martin
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top