DataBinding to ABL property. What's missing?

Posted by Admin on 19-Feb-2011 18:35

Hey all, I need to add a new data-bindable property to an ABL class inheriting the UltraTextEditor.

     DEFINE PUBLIC PROPERTY LookupKeyValue AS CHARACTER NO-UNDO

     GET.

     SET.

I have added an Event:
     DEFINE PUBLIC EVENT LookupKeyValueChanged DELEGATE System.EventHandler.
And using our ICustomTypeDescriptor implementationI have added the (dynamically at runtime)
[Bindable(true)]

attribute to the property. For the Visual Designer this property now does appear in the (Data Bindings) section of the Property sheet and the Visual Designer generates the required code to add the Binding object during InitializeComponent.

At runtime, an Exception is thrown:

System.ArgumentException: Unable to bind to the property LookupKeyValue of the target control.

So, what's missing to actually make Data binding work for ABL properties? Is that something we can add in the control, an overload to a method etc? Or is this really still a limitation of the ABL GUI for .NET bridge.

I've tested currently on my machine running 10.2B02. I'll test it soon on 10.2B03.

All Replies

Posted by Admin on 20-Feb-2011 09:54

Ok. That wasn't too difficult. The ABL exposes the Property to the .NET side only when it's part of a .NET Interface.

So now with the Bindable attribute set to True and a .NET Interface (defining the Property and the ...Changed Event) binding to an ABL property seems to work.

Posted by Marc on 20-Jan-2017 10:20

Hi,

I'm actually trying do to something like that...

And now wondering, how did you add 'dynamically' the bindable(true) attribute ?

This thread is closed