I'm trying to control my save button like this.
private void bsPatientSwitch_CurrentItemChanged( object sender, EventArgs e )
{
buttonSave.Enabled = aPatient.IsSavable;
}
I'm using the CurrentItemChanged on my binding source to enable/disable my save button.
The problem is when I'm adding or removing items in by child BusinessListBase nothing happens to the save button.
If I add this, ( EmploymentList is the child BusinessListBase ) the button works. But I don't understand why I should have to do this.
private void bsEmploymentList_CurrentItemChanged( object sender, EventArgs e )private void bsEmploymentList_CurrentItemChanged( object sender, EventArgs e )
{
buttonSave.Enabled = aPatient.IsSavable;
}
This only works when removing an Item from the list, not while adding..
--
Peder
Try using the ListChanged event, rather than the CurrentItemChanged event.
As for why you have to write the handler against the list. Well ultimately it's that BO that is raising the events in the first place. It's not too big a problem really.
Thank you, David! It now works.
private void bsEmploymentList_ListChanged( object sender, ListChangedEventArgs e )Copyright (c) Marimer LLC