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

GridViewComboBoxColumn SelectedValue based on RadGridView ItemsSource

1 Answer 236 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 23 May 2013, 08:11 AM

I have a RadGridView which contains GridViewComboBoxColumn as column.

Let consider RadGridView having ItemsSource as ObservableCollection<Product> and GridViewComboBoxColumn ItemsSource is List.

I want to set the GridViewComboBoxColumn SelectedItem property based on property in RadGridView ItemsSource i.e based on ProductTypeId in item/row/Product of ItemsSource/ObservableCollection<Product>.

However Product class has property ProductTypeId of type int and not ProductType object as property.

So how can I set GridViewComboBoxColumn SelectedItem so that it display value of Product.ProductTypeId as selected. And also I want to bind SeletedItem with Mode = TwoWay so that whenever ComboBox SelectedItem changes it will be reflected in RadGridView 
's ItemsSource.

One more thing the ProductId name is different in Product (Bound to RadGridView) class as well as ProductType class. However I can change this to be the same. Current it's like ProductType.Id and Product.TypeId.

Any help would be much appreciated.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Max
Top achievements
Rank 1
answered on 23 May 2013, 08:47 AM
Okay I found solution. Here is link for the same.

http://www.telerik.com/community/forums/wpf/gridview/gridviewcomboboxcolumn-datamemberbinding.aspx

Thanks to Maya. :)
Tags
GridView
Asked by
Max
Top achievements
Rank 1
Answers by
Max
Top achievements
Rank 1
Share this question
or