Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
Databinding to a ultracombo
posted

I have an ultratoolbarsmanager with a toolbar called "toolbarProjects" with an ultracombo tool on it. I would like to databind a list retrieved from a database to it.

I can't seem to work out how to access it in the toolbar and then to databind to it?

Any help would be much appreciated.

Cheers,
John

  • 44743
    posted

    You can bind a ComboBoxTool by creatng a BindableValueList and setting it as the ValueList on the ComboBoxTool. Also, all instances of a ComboBoxTool share the same ValueList, so you don't have to get the tool instance from the toolbar. You can just set the ValueList of the root tool in the toolbars manager:

    ComboBoxTool tool = (ComboBoxTool)this.ultraToolbarsManager1.Tools[ "ComboBoxTool1" ];

    string[ values = new string[{ "A", "B", "C" };
    BindableValueList valueList = new BindableValueList( values, this );
    valueList.BindingContext = new BindingContext();

    tool.ValueList = valueList;