Hi all
If I add a new comboboxtool to my UltraToolbarsManager at runtime, then the event ToolValueChanged never fired. If I add a comboboxtool with the designer then it works correctly.
I use the following code to add a comboboxtool at runtime
ComboBoxTool cbTest = new ComboBoxTool("combotest1");
ValueList oList = new ValueList();
ValueListItem oItem1 = new ValueListItem(); ValueListItem oItem2 = new ValueListItem();
oItem1.DisplayText = "aaa"; oItem2.DisplayText = "bbb";
oList.ValueListItems.Add(oItem1); oList.ValueListItems.Add(oItem2);
cbTest.ValueList = oList;
ultraToolbarsManager1.Tools.Add(cbTest); ultraToolbarsManager1.Ribbon.Tabs[0].Groups[0].Tools.AddTool(cbTest.Key);
Any ideas how can I solve that problem?
RegardsRoland
Sorry, clicked on the wrong button..
anyway, try
cbTest.ToolValueChanged+= new ToolEventHandler(...whatever the method is);
Its not working even after I added datavalue.
Hi I am trying to do the same thing but it doesn't work for me either. Did you found a solution? I tried setting the datavalue but still its not working.
Roland,
When you set the DisplayText on a ValueListItem, you need to also set its DataValue. Try setting both (ex: oItem1.DataValue = "aaa";) and see if that helps.
~Kim~