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
15
Setting initial selected values on a muti-select UltraCombo control
posted

Hi, I have an multi-select UltraCombo on a form which is bound to a list of values. What all the guides, samples, and questions seem to omit is how to bind the control to a list of initially selected values.

I have tried both manually setting and databinding the Value property to both a List<> and array of objects (the same type of object as the data source) but neither seem to work. In fact if I step through manually setting the .Value property, the value remains an empty array.

cboControl.Value = Controller.SelectedObjects.ToArray()

Does anyone have any ideas?

Ant

Parents
No Data
Reply
  • 27960
    Offline posted

    Hello Ant,

    From the code that you have provided, it looks like you are setting the Value of your UltraCombo to an array of the actual objects in your underlying data source. This won't do anything, as the Value is based on the ValueMember that you define for your UltraCombo. As such, I would recommend that you set the Value of your UltraCombo to a list or array of the elements that make up the values that exist on your data item with respect to the values that the ValueMember points at.

    I am attaching a sample project to demonstrate the above. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    UltraComboMultiSelectDemo.zip

Children
No Data