Combobox does not show value when leaving CellEditTemplate

2 posts, 0 answers
  1. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 15 Dec 2010 Link to this post


    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}" />

    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
  2. Maya
    Maya avatar
    4062 posts

    Posted 16 Dec 2010 Link to this post

    Hello Sodi We,

    Using the code-snippet you provided, I have tried to reproduce the issue you specified. Unfortunately, I was not able to. I am sending you the sample project I used  for testing it. Please take a look at it and let me know in case of any discrepancies according to your requirements.


    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top