Originally posted by rclarke
David, Thanks for the reply. I can't even get to the point that I can debug the AddingNew event because it seems to me that the DevEx XtraGrid is seeing the data for the child relation as readonly. For example, if there are no child entities, the expansion button to expand the view is greyed out. If there are existing child entities, I can expand the view to show them and the DevEx Embedded Navigator changes to reflect the child view but the buttons to Add and Delete are greyed out. I think this is due to the fact that DevForce presents the data as readonly because of the relation. I don't know how to override this behavior and provide my own Entitylist and associated BindingSource. So right now I can't go to Developer Express with an issue because I can't make it happen or not happen as the case may be.
  |
>> I don't know how to override this behavior and provide my own Entitylist and associated BindingSource.
Just code a property into the parent class that returns an EntityList:
public EntityList<Order> OrdersUnconstrained {
get {
return new EntityList<Order>(this.Orders);
}
}
>> the DevEx Embedded Navigator changes to reflect the child view but the buttons to Add and Delete are greyed out.
How to Enable the buttons would be a question for DevEx. If you can do it, there might be a secondary issue of taking charge of the behavior that occurs when they're clicked.
This is just a stab in the dark, but...when you work with a .NET BindingNavigator, which has Add and Delete buttons on it, you have to null out a couple of properties of the BindingNavigator itself to disengage built-in handlers that don't know anything about entities in a local cache, and so attempt to do the wrong things. Once you've nulled out those properties, the buttons are just plain old buttons, and you can wire handlers to them, and code any sort of action in those handlers.