Steven Davisworth
Steven Davisworth

Reputation: 429

Updating data in usercontrol2 from usercontrol1 update button

I've have a userControl that houses other userControls within tab items. They are made visible and cleared by interaction with various checkbox's on my parent userControl (all working). I've validation and writetodatabase functions in place which works for parent userControl. What I need to have happen is when "Update" (utilizes CommandBinding) button on uC1 is clicked, that all relevant child uC data on other tabs are saved to db as well. I've got validation to work but am stumped in saving the data of uC2/uC3/uC4 etc. ... any pointers would be most welcome. PS I'm trying to keep my uC's as loosely coupled as possible... I'm a beginner so please be gentle (step by step’s would be appreciated)

Thanks in advance.

Upvotes: 0

Views: 85

Answers (1)

David Cummins
David Cummins

Reputation: 988

You could put a Save event on each child control, and have the parent page/control subscribe to those events. Then it can ask the child controls to save themselves.

Upvotes: 1

Related Questions