Event after executing an update within a CustomDataSource

Topics: Web Client Software Factory
Nov 15, 2006 at 6:49 AM
I've run into a problem that I cannot seem to solve without modifying the CustomDataSource. I'd love to have you tell me that I'm doing something wrong, or possibly modify the CDS in future builds to support the following issue:

FormView connected to a CustomDataSource. The FormView contains a DropDown list that is NOT connected to a DataSource through the ASPX page, but IS connected by setting the DataSource parm in the codebehind.

When saving a record (either an Insert or an Update), the CustomDataSourceView.ExecuteInsert (for example) calls the OnDataSourceViewChanged (as it should). This tells all DataBound controls to essentially "refresh" their DataSource values. This works fine in the situation for the FormView that's bound through the ASPX. The problem is that the DropDown (contained in the FormView) is also told to refresh it's DataSource (which is then reset back to null - the value in the ASPX). There's no way to tell the DropDown (preferably through an event) what the proper DataSource is (and thus the dropdown comes back empty).

This is all using the MVP pattern from the Reference Implementation. In essence, I'm looking for some event to be fired after the OnDataSourceViewChanged method is called that will let me set the DataSource properly again for the DropDown so it rebinds appropriately.


Nov 17, 2006 at 3:56 PM

We are currently working on an updated version of the CustomDataSource that will fire the following events: Deleted, Inserted and Updated. These events will be fired after a delete/insert/update operation occurs and after the OnDataSourceViewChanged event is fired. You will have to handle these events if you need to execute code after an operation is completed. In fact, you will need to handle these events to reflect the changes in your model/data store, because these events will replace current DeleteItem, InserItem and UpdateItem events.

The new version of the data source control will probably be included in a future drop (not sure to have it in the next one - sorry)