Page 1 of 1

csDropDownList and ItemIndex in comboboxes not working?

Posted: Mon Mar 22, 2010 8:43 am
by adi
Hi,

I'm having problems selecting the default item in the combobox control with csDropDown style.

I want the user to choose one of the predefined values from the combobox, so:
1. I create a combobox
2. I provide the values: One, Two, Three
3. I set the ItemIndex to 0.

Until now everything works fine. The default item (One) is selected automatically. The combobox however allows the user to input some other value, not on the list.

4. I'm setting the style to csDropDownList and... setting the ItemIndex to 0 doesn't work anymore. After the dialog shows up, no item is selected.

Did I find a bug? Or am I doing something wrong here?

Best regards,
adi

Re: csDropDownList and ItemIndex in comboboxes not working?

Posted: Wed Apr 21, 2010 3:06 am
by adi
Hello,

Could someone from the IA team confirm that it's now working? or acting like that by design?
I think I've found a bug.

Best regards,
adi

Re: csDropDownList and ItemIndex in comboboxes not working?

Posted: Wed Apr 21, 2010 4:15 am
by MichaelNesmith
This is a misunderstanding on your part, regarding how to use the control:

Bind it to a variable,
Assign a default value to that variable,
And the engine will pre-select the list-box item corresponding to that variable's value.

You can also populate the listbox using variables :)

Re: csDropDownList and ItemIndex in comboboxes not working?

Posted: Wed Apr 21, 2010 9:02 am
by adi
Hi,

Many thanks.
Indeed my understanding of this control was different. I thought that the ItemIndex will take precedence over the variable.
You saved my day.

Best regards,
adi

Re: csDropDownList and ItemIndex in comboboxes not working?

Posted: Wed Apr 21, 2010 9:15 am
by adi
Hello,

One more thing - I was misled because of the way that "Object behavior" for comboboxes is displayed.
The "Receives information" field is disabled and the "Write values to" is enabled, which suggests one-way binding only, from control to variable. In such case the ItemIndex would be used to provide the initial value.

In other controls in the first combobox you can choose the "Written variable value" which suggests two-way binding.

Best regards,
adi

Re: csDropDownList and ItemIndex in comboboxes not working?

Posted: Sat Feb 27, 2016 6:19 am
by Dany
I was also confused by this. IMHO it is extremely unintiutive and there's no details to be found.
Another thing to fix is to have th object inspector display the control class name (or type). Inferring it from visual and the properties list is not always so easy.

Regards,

/Dany

Re: csDropDownList and ItemIndex in comboboxes not working?

Posted: Mon Feb 29, 2016 2:23 pm
by FrancescoT
Dear Dany,

we will take in account your note.

Thanks!