This is a migrated thread and some comments may be shown as answers.

GridviewComboboxColumn linq2sql

3 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 28 Oct 2011, 08:42 AM
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




                                          

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 28 Oct 2011, 12:57 PM
Hello Thomas,

What kind of error do you receive form the filtering control ? The exception and some stacktrace would be helpful.

All the best,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Thomas
Top achievements
Rank 1
answered on 31 Oct 2011, 08:14 AM
Hello,
With the latest build the filter funnel isn't shown in the case where I set SelectedValueMemberPath="". I suppose the error I got with an earlier build. So the question now is: why isn't the filter funnel displayed?
0
Pavel Pavlov
Telerik team
answered on 07 Nov 2011, 11:22 AM
Hello Thomas,

I was trying to reproduce/isolate the issue here, however with no success. Here is something you need to check. Typically  RadGridView cannot sort, group or filter on  type since if you do not implement IComparable<> and/or IEquatable<T>. If you cannot filter on some type RadGridView will not show filtering UI.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or