LookupCombobox doesn't work
Issue #9
resolved
I am looking for an Lookup-Combobox. So I try to bind a TCombobox (csDropDownList) to a Class:
type TSample = class
..
property Code:string
property Description:string
end;
cb.View.ItemsSource:=SampleList as IList;
cb.View.ItemTemplate:=TColumnDataTemplate.Create(['Description']);
Now I suspect to get the current selected TSample-object in cb.View.CurrentItem. But there is NIL.
If I try the same with TListbox all is working. So I can get the 'Code' from the selected Description.
Comments (3)
-
repo owner -
Account Deleted I have declared it in interface part.
If I use a TListbox all works right. I changed only
cb.View.ItemsSource:=SampleList as IList; cb.View.ItemTemplate:=TColumnDataTemplate.Create(['Description']);
to
lst.View.ItemsSource:=SampleList as IList; lst.View.ItemTemplate:=TColumnDataTemplate.Create(['Description']);
and I have a TSample-object in lst.View.CurrentItem
but not if I use TCombobox with Style csDropDownList
-
repo owner - changed status to resolved
fixed issue
#9→ <<cset 828bf81c2194>>
- Log in to comment
Did you declare your TSample class in the implementation part? In that case it is missing some RTTI and it does not work (more precisely because it is missing the QualifiedName).
You need to move that to the interface part and it will work.