Entity Framework - Data bound combobox does not reflect changes made after inserting new data?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

Up vote 0 down vote favorite share g+ share fb share tw.

I have a simple WPF window with DataGrid, Save button and ComboBox. The DataGrid is bounded to "students" table and ComboBox bounded to the same table, but with another CollectionViewSource: C# code: ComputerSchool. Computer_schoolEntities computer_schoolEntities = DataBaseHelper.

Ent; System.Windows.Data. CollectionViewSource studentsViewSource = ((System.Windows.Data. CollectionViewSource)(this.

FindResource("studentsViewSource"))); System.Data.Objects. ObjectQuery studentsQuery = computer_schoolEntities. Students; studentsViewSource.

Source = studentsQuery. Execute(System.Data.Objects.MergeOption. AppendOnly); System.Windows.Data.

CollectionViewSource studentsLookupViewSource = ((System.Windows.Data. CollectionViewSource)(this. FindResource("studentsLookup"))); System.Data.Objects.

ObjectQuery studentsLookupQuery = computer_schoolEntities. Students; studentsLookupViewSource. Source = studentsQuery.

Execute(System.Data.Objects.MergeOption. AppendOnly); The problem is that the ComboBox doesn't refresh it's items collection, when i'm inserting a new row in DataGrid, on the other hand, when i'm deleting or updating rows in DataGrid, the ComboBox refreshing just fine, even without context.SaveChanges(). I saw the same problem here - C# Entity Framework - Data bound combobox does not reflect changes made after .SaveChanges() , but after computerSchoolEntities.students.toList() the ComboBox doesn't react on any activity on DataGrid even after context.SaveChanges().

Anybody knows solution? C# wpf xaml data-binding entity-framework-4 link|improve this question edited Jan 8 at 15:58H.B.43k61645 asked Jan 8 at 15:55helcoder262.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions