Completed
Last Updated: 12 Apr 2016 12:53 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 17 Mar 2016 15:32
Category: RibbonBar
Type: Bug Report
0
FIX. RadRibbonBar - ArgumentOutOfRangeException when inserting command tabs in the Form.Load event
To reproduce: add 3 ribbon tabs at design time and use the following code snippet:

public Form1()
{
    InitializeComponent(); 
}

private void InsertTabs()
{
    for (int i = 1; i <= 5; i++)
    {
        var index = radRibbonBar1.CommandTabs.IndexOf(this.ribbonTab3);
        radRibbonBar1.CommandTabs.Insert(index, new RibbonTab(string.Format("Tab {0}", i.ToString())));
    }
}

private void Form1_Load(object sender, EventArgs e)
{
    InsertTabs();
}

Workaround: insert the tabs in the form's constructor.
0 comments