New to livebindings and so far it hasn't been a smooth journey. I'm trying to link a TRadioGroup.ItemIndex to a TObject property that's an Integer.
So I know the bindinglist/adapter is ok as other properties in the Object is bound correctly and bidirectionally to TEdit, TStringGrid (a list of Objects), etc.
Steps I though I should take:
- So I drop a TRadioGroup
- In Visual Livebindings, I click on the (...) and make the ItemIndex property 'bindable'
- I drag a link between Radio's ItemIndex and AdapterBindSource's Integer field.
Problems: It's only 1 way, the arrows in VLB indicates this. Radio works, but I cannot change the Object's value via the RadioButtons, only update RadioButtons from TObject.
So I though (again) I should:
- Delete the link Create a new BindingExpression
- Direction=BiDirectional
- ControlComponent/Expression: MyRadioGroup/ItemIndex
- SourceComponent/Expression : MyAdapterBindSource/MyIntegerField
But then I get error:
"Unable to cast or find converters between types TBindSourceAdapterReadWriteField<System.Integer> and Integer"