This question is locked. New answers and comments are not allowed.
I have a grid view, with a combo box inside it. The combo box works great. It has the items in it, you can select them, and when you select something, the value shows up correctly in the grid. The problem I am having is that the initial value in the column, which comes from the grid's data source, doesn't show. I have done combo boxes in grids before, but this is the first I have done one that has an item template.
Here is the code from my XAML:
HoursTypeCode is the database value name for the column, from the Grid's data source
Text is what should show up in the combo box item list
Value is the code behind the Text in the combo box
I would have thought that DataMemberBinding would be where I put HoursTypeCode, but when I do that, it breaks the combobox and it ends up with no items in it.
Here is the code for the template, which I am using in other places and it works fine, but I thought I would include it:
Here is the code from my XAML:
<
telerik:GridViewComboBoxColumn
DataMemberBinding
=
"{Binding Value}"
ItemsSource
=
"{Binding Items}"
DisplayMemberPath
=
"HoursTypeCode"
EditTriggers
=
"CellClick"
Header
=
"Hours Type"
IsReadOnlyBinding
=
"{Binding IsRowReadOnly}"
ItemTemplate
=
"{StaticResource EnableTemplate}"
SelectedValueMemberPath
=
"Value"
telerik:TextSearch.TextPath
=
"Text"
UniqueName
=
"rcbxGridHoursType"
/>
HoursTypeCode is the database value name for the column, from the Grid's data source
Text is what should show up in the combo box item list
Value is the code behind the Text in the combo box
I would have thought that DataMemberBinding would be where I put HoursTypeCode, but when I do that, it breaks the combobox and it ends up with no items in it.
Here is the code for the template, which I am using in other places and it works fine, but I thought I would include it:
<
telerik:ContainerBindingCollection
x:Key
=
"IsEnabledBinding"
>
<
telerik:ContainerBinding
PropertyName
=
"IsEnabled"
Binding
=
"{Binding IsEnabled, Mode=TwoWay}"
/>
</
telerik:ContainerBindingCollection
>
<
DataTemplate
x:Key
=
"EnableTemplate"
telerik:ContainerBinding.ContainerBindings
=
"{StaticResource IsEnabledBinding}"
>
<
TextBlock
Text
=
"{Binding Text}"
/>
</
DataTemplate
>