Hello,
We have a usercontrol that has a radgridview. On one of the columns we set a celledittemplate:
The column:
When I add a new row to the grid. The grid is now in edit mode and the combobox is shown. I change the selected item in the combobox. If I TAB to the next cell, the first cell leaves the edit template, but the OptionDetail.Description is not shown. When I save and open this usercontrol again, all values have been correctly saved and the description is now visible.
If, instead of a TAB to the next cell, I click another existing row after choosing a value from the combobox, the OptionDetail.Description is correctly shown.
When editing existing items, the description is correctly shown after TABing out of the combobox cell.
To clarify further: We use RIA Services. The itemssource of the grid is set to an ObservableCollection of Contact Entities. A Contact Entity has an RIA association with an OptionDetail entity. The Contacts and the OptionDetails are loaded via separate queries in the same context. That is why the DataMemberBinding to OptionDetail.Description works (RIA couples related entities loaded in the same context automatically). In the celledittemplate, we bind directly to the ViewModel property OptionDetailList that contains all possible OptionDetails for a Contact.
We realise this could also be achieved with a RadGridViewComboBoxColumn, but this doesn't seem to work well with the Contacts and OptionDetails being loaded in different queries. Researching the forums has lead us to this workaround.
Thank You,
Sodi We
We have a usercontrol that has a radgridview. On one of the columns we set a celledittemplate:
<
DataTemplate
x:Key
=
"OptionDetailCellEditTemplate"
>
<
telerik:RadComboBox
ItemsSource
=
"{Binding ViewModel.OptionDetailList, Source={StaticResource VMC}}"
DisplayMemberPath
=
"Description"
SelectedValuePath
=
"Id"
SelectedValue
=
"{Binding ContactOptionDetailId, Mode=TwoWay}"
/>
</
DataTemplate
>
The column:
<
telerikGrid:GridViewDataColumn
DataMemberBinding
=
"{Binding OptionDetail.Description, Mode=TwoWay}"
CellEditTemplate
=
"{StaticResource OptionDetailCellEditTemplate}"
/>
When I add a new row to the grid. The grid is now in edit mode and the combobox is shown. I change the selected item in the combobox. If I TAB to the next cell, the first cell leaves the edit template, but the OptionDetail.Description is not shown. When I save and open this usercontrol again, all values have been correctly saved and the description is now visible.
If, instead of a TAB to the next cell, I click another existing row after choosing a value from the combobox, the OptionDetail.Description is correctly shown.
When editing existing items, the description is correctly shown after TABing out of the combobox cell.
To clarify further: We use RIA Services. The itemssource of the grid is set to an ObservableCollection of Contact Entities. A Contact Entity has an RIA association with an OptionDetail entity. The Contacts and the OptionDetails are loaded via separate queries in the same context. That is why the DataMemberBinding to OptionDetail.Description works (RIA couples related entities loaded in the same context automatically). In the celledittemplate, we bind directly to the ViewModel property OptionDetailList that contains all possible OptionDetails for a Contact.
We realise this could also be achieved with a RadGridViewComboBoxColumn, but this doesn't seem to work well with the Contacts and OptionDetails being loaded in different queries. Researching the forums has lead us to this workaround.
Thank You,
Sodi We