views:

301

answers:

1

Hi There, I am attempting to construct a formview that will edit two related objects at once. In basic terms, I have a Linq To SQL object of teacher which has exactly one school. The formview has no problem displaying the data, but when in edit mode will only save the changes done to the parent object. Changes to the school data are seemingly ignored

Is there any way to achieve the kind of thing I want here?

Thanks,

+1  A: 

This is probably similar to what I'm doing, although I'm not using Linq. I'm using a vanilla ObjectDataSource and displaying data in a drop down list via a different data source. Add a new Event for the FormView that is called during the "ItemUpdating" event. Embed code to directly save your changes in that event. Then as the FormView is saved, everything else is saved.

If you want it to be saved after the FormView, use the ItemUpdated event instead. It's a bit of a manual process, but it does get around the problem.

Mike Taber