Reseting DataContext is nulling out Hierarchical ComboBox value.

Currently we are reseting the datacontext to refresh the bindings to get new data to display correctly. The problem I have is when there is a combobox that has another combobox set as it's binding source. When the datacontext is nulled out, the dataset value for that dependant combo gets wiped out. I thought that if I could suspend binding prior to nulling out the datacontext, then the two-way binding would not wipe out this value. I'm sure it is doing this because it's parent combo has no datacontext and it is trying to keep it in sync. How can I suspending all binding prior to doing this?

//Refresh databindings

ObjectDataProvider addEditSource =this.addEditGrid.FindResource("EditResultData")asObjectDataProvider;

this.addEditGrid.DataContext =null;

this.addEditGrid.DataContext = addEditSource.ObjectInstance;

[1068 byte] By [RodYager] at [2008-1-4]

Visual Studio Orcas

Site Classified