Subject Re: [IBO] TIB_ComboBox dropped on a TIB_Grid
Author Lucas Franzen
mirco@... schrieb:
> > Cut and paste from the IBO Help:
> >
> > This control allows a standard combo box to be bound to a data
> column.
> > The values of the drop-down list must be supplied by assigning them
> to
> > the Items property manually at design-time or run-time.
> >
> > The ItemValues property can be used to provide a table of values to
> > store in the database instead of the entries listed in the Items
> > property.
> > >>>>> Note that this property is ignored if the Style is
> csDropDown. <<<<<
> >
> So what is the point? My combobox is csDropDown, otherwise I cannot
> enter values other than in the list. Still, the grid does not show
> values in the column (its empty) for
> (a) any value if I don't have ItemValues
> (b) any value not in the list if I have ItemValues
> ... so I don't see that the combobox ignored ItemValues...
> Item values do properly show up when the combobox is active, but only
> for the current cell.
> Anyway, none of the settings makes the items appear in the grid
> always and no matter if in the list or not. Is this a bug?

Okay, an exmaple:

Items ItemValues
One 1
Two 2
Three 3
Four 4
Five 5

Let's say you have an Integer column MYINT in your table and want to
show it in a ComboBox.

If the style is csDropDown then the ItemValues is ignored, thus when
opening the query there will just be shown "One" for MYINT=1, "Two" if
MYINT=2, etc. as long as there's a matching entry for Items in
ItemValues (ie. Items.Index < ItemValues.Count).

BUT the value won't be represented when posting, so if you change from
ONE to TWO and try to post you'll get an error that TWO is not a valid
integer (this is meant by: ItemValues are ignored in csDropDown-Style)

If the style is DropDownList you'd see the corresponding string for
MYINT (or empty if it wouldn't match).
But in that case you can't enter a value, as you already stated.
And in that case the choosen Item will be substituted by the matching
ItemValue when psoting.

Maybe have a look at the OnNotInList event of the TIB_CustomCombo.

Not everything that doesn't work as you're expecting is a bug.