In the code below I am trying to setup a combo box in a RadGridView. The Grid is being setup in a DataTemplate in the UserControl.Resources and is called by a RadTabControl and bound to a list of items. The item properties are bound to several controls in this DataTemplate, one of which is a Gridview showing a property that is a child list of objects. Among these proeperties of the chis child table is a setting that is a flag with two possibilities. When I run it is seems to work ... to a point. I can select and drop the box and select one fo the two selections it appears in the column. But when i click anywhere else and the control loses focus, the text in the column becomes the text describiing the combobox control ("Telerick.Windows.Controls.RadComboBoxItem"). I have to assume this is due to the way I am setting up the column. ut it is the only example I have found so far that allowed me to set the values in the list box in the Xaml and bind the selected value to the value in the object. If anyone can tell me what I am doing wrong or suggest a better way to do it, I would be very appreciative.
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding DisplayColFlag, Mode=TwoWay}" Header="PPD/COL"> |
<telerikGridView:GridViewDataColumn.CellTemplate> |
<DataTemplate> |
<TextBlock Text="{Binding DisplayColFlag}" /> |
</DataTemplate> |
</telerikGridView:GridViewDataColumn.CellTemplate> |
<telerikGridView:GridViewDataColumn.CellEditTemplate> |
<DataTemplate> |
<telerikInput:RadComboBox x:Name="cboColFlag" SelectedValue="{Binding DisplayColFlag, Mode=TwoWay}"> |
<telerikInput:RadComboBoxItem Content="PPD Only" /> |
<telerikInput:RadComboBoxItem Content="PPD+COL" /> |
</telerikInput:RadComboBox> |
</DataTemplate> |
</telerikGridView:GridViewDataColumn.CellEditTemplate> |
</telerikGridView:GridViewDataColumn> |