CSLA 3.8 Children/ Windows Forms Data Grid View

CSLA 3.8 Children/ Windows Forms Data Grid View

Old forum URL: forums.lhotka.net/forums/t/11736.aspx

ebick posted on Saturday, December 08, 2012

I'm not too versed in using the DataGridView control for editing, but I am having an issue that I hope someone can assist with.

I have a parent business base object and a child business base object.  The OK button on the edit form is bound to the parent's issavable property.  The grid is bound to the child collection.  When I edit the column in the grid, it hits the child's property just fine and sets the child bo to is dirty.  The parent's reference to the child collection recognizes that the child collection is now dirty.  

However, the ok button does not light up.....it doesn't seem to be refreshing that binding.  


The setting for the binding is on OnPropertyChange.

Any thoughts?



JonnyBee replied on Sunday, December 09, 2012

The IsXYZ properties does not implement OnPropertyChanged in CSLA 3.x so this will no work.

You should rather set the <Button>.Enabled in the Form by hooking into the <bo>.OnPropertyChanged and <bo>.OnChildChanged events.

Databinding in WindowsForms is not so "friendly" for having OnPropertyChanged on all the IsXYZ properties.

Copyright (c) Marimer LLC