Does anyone know why I can successfully setup a Button Databinding to "IsDirty" flag like so:
Button1.Databindings.Add("Enabled", MyBO, "IsDirty")
but can not set it up to a custom readonly property in my BO:
Button1.Databindings.Add("Enabled", MyBO, "HasItems")
This later binding throws the error: "Cannot bind to the property or column HasItems on the DataSource"
It doesn't make sence
ward0093
Thanks Andy... But binding to the "IsDirty" or "AllowEdit" actually works with no errors
my custom readonly property "HasItems" is what is failing. Why is that?
ward0093
Andy's post regarding IsDirty, etc. is regarding CSLA 2.0. Those particular properties are indeed marked as [Browseable(false)], so data binding does not work as it did with CSLA 1.x.
However, that has no bearing on why your custom property isn't working.
correct... also... I am setting these bindings up threw code at runtime... not in the designer
I keep reading posts on " PropertyDescriptor "... do I need this for my custom properties?
I wouldn't think you'd need to mess with PropertyDescriptors. Obviously, CSLA doesn't use them, and data binding works fine.
Other than verifying that the data source you're assigning actually does expose 'HasItems', I can't think of anything else to check. Sorry...
You should be able to do this. I've done the exact same thing in the past.
Only thing I can think of off the top of my head is to make sure your property is public (I know I sometimes forget). Not sure that makes much difference, because data binding depends on reflection quite a bit, but it's something to check.
actually... binding to AllowEdit... fails as well.... but IsDirty and IsNew all work fine...
ward0093
Copyright (c) Marimer LLC