We are currently using a GridViewComboBoxColumn control in a GridView, and like a few others, we would like the combobox editor (arrow) to always be visible. Most answers have involved using the said 'GridViewComboBoxColumn' or a 'GridViewDataColumn' in conjunction with a DataTemplate to target the ComboBox.
I have both approaches, both with the same result. I get a column of combo boxes, but no data.
This is our current markup:
<
telerik:GridViewComboBoxColumn
x:Name
=
"ColP4"
Width
=
"150"
IsReadOnly
=
"False"
IsComboBoxEditable
=
"False"
EditTriggers
=
"CellClick"
ItemsSource
=
"{Binding PermissionCollection}"
DataMemberBinding
=
"{Binding Col4}"
UniqueName
=
"Permission"
Header
=
"{Binding Source={StaticResource TranslationAreas}, Path=[exportproject][TXT_COLUMN_5]}"
DisplayMemberPath
=
"Name"
SelectedValueMemberPath
=
"ID"
/>
ItemsSource is an ObservableCollection of type 'Permission'. Permission has two properties, int: ID and str: Name.
This looks like what we want, only with no data:
<
telerik:GridViewDataColumn
x:Name
=
"ColP4"
DataMemberBinding
=
"{Binding Col4}"
Header="{Binding Source={StaticResource TranslationAreas}, Path=[exportproject]
[TXT_COLUMN_5]}" >
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
ComboBox
DisplayMemberPath
=
"Name"
ItemsSource
=
"{Binding PermissionCollection}"
SelectedValue
=
"ID"
SelectedValuePath
=
"ID"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
I'm sure the problem lies with the databinding. Any help is very much appreciated.