this.DataContext = this.CourierAirWayBill.DataSet.Tables[this.CourierAirWayBill.TableName].DefaultView;in order to show data from a display only view of the data (basically, I am showing data from related tables).
private void btnNew_Click(object sender, RoutedEventArgs e) { this.IgnoreNavigation = true; if (this.grdCourierAirWayBills.Items.Count == 0) { this.DataContext = this.CourierAirWayBill.EntityList; //this.DataContext = this.CourierAirWayBill.DataSet.Tables[this.CourierAirWayBill.TableName].DefaultView; } this.grdCourierAirWayBills.SelectedItem = this.CourierAirWayBill.Entity; this.IgnoreNavigation = false; }I believe the problem is because I'm setting the DataContext to the EntityList, but when I try the commented line of code it doesn't work either.