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

Add items programatically

3 Answers 110 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Mário
Top achievements
Rank 1
Mário asked on 27 Apr 2015, 06:50 PM

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

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 28 Apr 2015, 01:05 PM
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.

 
0
Mário
Top achievements
Rank 1
answered on 05 May 2015, 07:14 PM

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?

 

 

0
Martin Ivanov
Telerik team
answered on 06 May 2015, 01:33 PM
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.

 
Tags
OutlookBar
Asked by
Mário
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Mário
Top achievements
Rank 1
Share this question
or