I want to force the toolbarstyle but I can't get the "Office2013" to display when formloads.
Using SelectedIndex gets an error (
System.ArgumentOutOfRangeException occurredHResult=0x80131502Message=Index was out of range. Must be non-negative and less than the size of the collection.)
Code used:
Infragistics.Win.UltraWinToolbars.ComboBoxTool cb = new Infragistics.Win.UltraWinToolbars.ComboBoxTool("ComboBoxTool1");ultraToolbarsManager1.Style = ToolbarStyle.Office2013;cb.SelectedIndex =0;
Ok, I finally figured out why this wasn't working. In the custom properties where I supplied the data list, the Data value didn't have "Office2013". I had to write in Office2013 then add the comboTool.Value = ToolbarStyle.Office2013 and now it works.
Thank you!
Felix
With the sample I wasn't able to get working. I am testing your latest one now and it does fire the Event. But it still doesn't force the word Offce2013 into the combobox display. I will keep working this and let you know.
Based on your reply, I'm not sure if you managed to get this working or are trying to get a reference to the ComboBoxTool so you can set the Value property. If you are trying to get the root tool, you can use code similar to:
ComboxBoxTool comboTool = (ComboxBoxTool)this.ultraToolbarsManager1.Tools["comboBoxTool1"];
comboTool.Value = ToolbarStyle.Office2013;
Ok, since I do not programmatically create my combobox and my value list is already added, I do I to my specific comboBox which has a key of "comboBoxTool1" so then I can add " // Assign the value to the root ComboBoxTool. This will trigger the ToolValueChanged event, and cause the Style of the UltraToolbarsManager to be set. comboboxtool.Value = ToolbarStyle.Office2013;"
Ok, yes your example is what I want to do. I'm going to try to see how to change my code to the "Office2013" to display.