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

RadGridView ComboBox Column Binding problem

5 Answers 203 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Xu
Top achievements
Rank 1
Xu asked on 24 May 2011, 06:38 PM
Hi, Telerik Guys

I have a question for ComboBox Column, I posted this issue in my blog, is this really a bug or it was designed as it?
http://chunxusky.blogspot.com/2011/05/telerik-silverlight-radgridview.html

it's really annoying when I try to use MVVM to bind the ComboBox column

thanks

5 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 May 2011, 11:53 AM
Hello Xu,

In fact it is not a bug . As described in the documentation , you  should use the ItemsSourceBinding property in this scenario.

So as a fix , in your XAML , just replace the 'ItemsSurce'  with 'ItemsSourceBinding' and this should fix the things up.

Regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Pavel Pavlov
Telerik team
answered on 25 May 2011, 11:56 AM
Hello Xu,

As a side note, in case  the proposed fix works for you I would kindly ask you to update your blog , as  it may cause some confusion  and misleading.

All the best,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Xu
Top achievements
Rank 1
answered on 25 May 2011, 02:47 PM
hello, Telerik Admin

I understand very well what difference between ItemsSource and ItemsSourceBinding and I tried to use ItemsSourceBinding to replace ItemsSource, it doesn't work... furthermore , it's getting worse, nothing displayed in the ComboBox column

at the end of my blog, I provided a sample project to download, have you ever try this project? in that demo, I show this issue.


0
Pavel Pavlov
Telerik team
answered on 25 May 2011, 03:16 PM
Hello Xu,

Thanks for pointing me out the sample . I took a look  and here are my findings : 

Having :
ItemsSource="{Binding Countries}"
Means "Take the items source from the Countries property of the datacontext of the cell".



However the DataContext of the cell, when data is loaded , is set to the business object relevant to the row , not the datacontext of the page.

This is by design .



In other words:
The datacontext of the cell will be a "People" object , which of course does not have the "Countries" property .

That is why the binding gets broken .


Hope this clarifies the things.

Regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alejandro
Top achievements
Rank 1
answered on 08 Mar 2012, 03:57 PM
Is there any fix of this? Any way to make this work?
Tags
GridView
Asked by
Xu
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Xu
Top achievements
Rank 1
Alejandro
Top achievements
Rank 1
Share this question
or