Hello,
I have a gridview bound to an observablecollection( of linq to sql class)
For editing a foreignkey in this class I use a gridviewcombocolumn:
Grid.Columns.Add(New GridViewComboBoxColumn With {
.Header = "PC",
.ItemsSource = vm.PurchaseCodes,
.SelectedValueMemberPath = "",
.DataMemberBinding = New Binding("PurchaseCode"),
.DisplayMemberPath = "DisplayName"})
In this situation the filtercontrol gives an error and also I've the idea that binding like this gives slower performance than binding to "PurchaseCodeID", like this:
Grid.Columns.Add(New GridViewComboBoxColumn With {
.Header = "PC",
.ItemsSource = vm.PurchaseCodes,
.SelectedValueMemberPath = "PurchaseCodeID",
.DataMemberBinding = New Binding("PurchaseCodeID"),
.DisplayMemberPath = "DisplayName"})
But in this situation linq to sql gives a foreignkeyreferencealreadyhasvalueexception.
Do you have any suggestions for my problem?
Thomas
I have a gridview bound to an observablecollection( of linq to sql class)
For editing a foreignkey in this class I use a gridviewcombocolumn:
Grid.Columns.Add(New GridViewComboBoxColumn With {
.Header = "PC",
.ItemsSource = vm.PurchaseCodes,
.SelectedValueMemberPath = "",
.DataMemberBinding = New Binding("PurchaseCode"),
.DisplayMemberPath = "DisplayName"})
In this situation the filtercontrol gives an error and also I've the idea that binding like this gives slower performance than binding to "PurchaseCodeID", like this:
Grid.Columns.Add(New GridViewComboBoxColumn With {
.Header = "PC",
.ItemsSource = vm.PurchaseCodes,
.SelectedValueMemberPath = "PurchaseCodeID",
.DataMemberBinding = New Binding("PurchaseCodeID"),
.DisplayMemberPath = "DisplayName"})
But in this situation linq to sql gives a foreignkeyreferencealreadyhasvalueexception.
Do you have any suggestions for my problem?
Thomas