Disable bound control

Posts   
 
    
zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 19-Sep-2005 16:25:54   

Hello,

Is there a way to disable bounded GUI controls when setting a entityfield property. In other words: I want this behaviour: When I set a entityfield-property to true or false then the value of that property enables/disables any bound controls in the user-interface.

Greetz,

zaad

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 19-Sep-2005 16:52:27   

That's default databinding wizardry wink

someControl.DataBindings.Add("Enabled", yourEntity, "YourProperty");

(or similar)

Frans Bouma | Lead developer LLBLGen Pro
zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 19-Sep-2005 17:25:02   

OK, I haven't thought of that yet. disappointed

Since 'IsReadOnly' is a read-only field property, I have to make a custom property to make this work, right?

Greetz,

zaad

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 19-Sep-2005 17:43:36   

zaad wrote:

OK, I haven't thought of that yet. disappointed

Since 'IsReadOnly' is a read-only field property, I have to make a custom property to make this work, right?

Greetz,

zaad

IsReadOnly is saying something about the field itself, not the value it contains. I understood from your posting that you wanted to enable/disable controls based on the VALUE of a field (like customer.IsGoldCustomer, which is true or false, when it is set to true, the groupbox for the goldcustomers is enabled)

Frans Bouma | Lead developer LLBLGen Pro
zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 19-Sep-2005 21:46:13   

Thanks for your thoughts. I found a solution now. I made a inherited class from the entityclass, added a new boolean field, and on the UI bound "Enabled" to that field.

greetz,

zaad simple_smile