Bidirectional TRADIOGroup redirection in VCL

New to living attachments, and so far it has been an unspoken journey. I am trying to associate TRadioGroup.ItemIndex with the TObject property of that Integer.

So, I know that bindlist / adapter is fine, since the other properties of the object are bound correctly and bi-directionally to TEdit, TStringGrid (list of objects), etc.

Steps, although I have to take:

  • Therefore I throw TRadioGroup
  • In Visual Livebindings, I click on (...) and create the ItemIndex 'bindable' property
  • I am dragging a link between the Radio ItemIndex and AdapterBindSource Integer fields.

Problems: This is only one way, arrows in VLB indicate this. Radio works, but I cannot change the value of Object via RadioButtons, only update RadioButtons from TObject.

So, I (again) should:

  • Remove Link Create New BindingExpression
  • Direction = BiDirectional
  • ControlComponent / Expression: MyRadioGroup / ItemIndex
  • SourceComponent / Expression: MyAdapterBindSource / MyIntegerField

But then I get the error:

"Unable to cast or find converters between types TBindSourceAdapterReadWriteField<System.Integer> and Integer" 
+4
source share

Source: https://habr.com/ru/post/1469487/


All Articles