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

GridViewComboBoxColumn not binding

2 Answers 66 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karthik
Top achievements
Rank 1
Karthik asked on 13 Feb 2012, 11:10 PM
I have a RadGridView inside which I have a GridViewComboBoxColumn. For some reason my combo box column always appears to be empty. All the other columns seems to bind with the ItemSource properly

Here is how my RadGridView looks like

<telerikGrid:RadGridView x:Name="VGrid" d:LayoutOverrides="Width" Grid.Row="1" Grid.ColumnSpan="2"
RowIndicatorVisibility="Collapsed" MinHeight="100" ShowGroupPanel="False"
 AutoGenerateColumns="False" ItemsSource="{Binding Rows}">

Row is a simple class which has a bunch of string properties and also a collection of objects called Source.
Source is also a simple class with properties, id and name.

My Combobox column looks like this


<telerikGrid:GridViewComboBoxColumn Header="Source" IsSortable="True"
ItemsSource="{Binding Sources}" DataMemberBinding="{Binding id}"
SelectedValueMemberPath
="{Binding id}"  ></telerikGrid:GridViewComboBoxColumn>

I have read a lot of posts similar to the problem that am facing, but couldn't really figure out why my combo box column is empty.
(Of course I have checked more than once that my Sources collection in Row is not empty).

Any ideas, clues will be greatly appreciated

(PS: I have the same thread duplicated in combobox category as well)

Thanks
K

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 14 Feb 2012, 07:32 AM
Hi,

 I believe that in your case you should set he source using ItemsSourceBinding instead of ItemsSource. More details on how the GridViewComboBoxColumn works is available here.

Does this solves your problem?

Regards,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Karthik
Top achievements
Rank 1
answered on 14 Feb 2012, 08:27 PM
Thanks for the reply that does solve the problem, but going ahead am stumbling upon another issue. When I select an item from the CombBox, the selected item does not get bound to the property unless I click on another cell. In other words the selected item does not get updated until the cell looses focus.

Is there a way around it?

Thanks
K
Tags
GridView
Asked by
Karthik
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Karthik
Top achievements
Rank 1
Share this question
or