4

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:

  1. So I drop a TRadioGroup
  2. In Visual Livebindings, I click on the (...) and make the ItemIndex property 'bindable'
  3. 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:

  1. Delete the link Create a new BindingExpression
  2. Direction=BiDirectional
  3. ControlComponent/Expression: MyRadioGroup/ItemIndex
  4. SourceComponent/Expression : MyAdapterBindSource/MyIntegerField

But then I get error:

"Unable to cast or find converters between types TBindSourceAdapterReadWriteField<System.Integer> and Integer"
TLama
  • 75,147
  • 17
  • 214
  • 392
AntonE
  • 53
  • 3

0 Answers0