Has anyone found a way to 'persist' data bindings?
We are using strongly typed datasets to pass data across our tiers. One advantage is the ability to drop the dataset on a Windows form and bind the controls to it.
The forms invariably have some sort of 'Refresh' procedure. Whenever the data is refreshed, the instance of our dataset is replaced with a new one. This 'blows' all the bindings and the controls have to be rebound.
Currently we have a BindControls method in our base form and put all of the binding code into this method. The problem is that it means either writing all the binding code calls by hand in this method (not using the visual designer), or selectively copying binding code from the generated code into this method and adding .Clear calls, etc. Messy, messy.
Another option we are considering is to persist the instance of the original dataset and use another instance to bring in the data, then copy it into our original. But this means carrying the overhead of 2 complete copies of the data in memory.
Ideas?
Regards,
Bill Dimes
"There's never enough time to do it right the first time, but there's always time to do it over"