Dynamically Add Items to ComboBox or DropDown

Add-in Express™ Support Service
That's what is more important than anything else

Dynamically Add Items to ComboBox or DropDown
 
Niall Pedlow




Posts: 2
Joined: 2017-03-06
Hi,

is it currently possible to add items dynamically to a ComboBox or a DropDown? I've done my best to search for this, but can't find any sample code anywhere.

Thanks
Niall
Posted 06 Mar, 2017 01:31:49 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Niall,

int counter = 0;
private void adxRibbonButton1_OnClick(object sender, IRibbonControl control, bool pressed) {
    ADXRibbonItem anItem = new ADXRibbonItem(this.components);
    anItem.Caption = "custom item " + (++counter).ToString();
    anItem.Id = "myUniquId" + counter.ToString();
    this.adxRibbonComboBox1.Items.Add(anItem);
}


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Mar, 2017 05:50:47 Top
Niall Pedlow




Posts: 2
Joined: 2017-03-06
Thankyou Andrei!
Posted 12 Mar, 2017 19:19:10 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
You are welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Mar, 2017 03:32:46 Top