ComboBox Column not displaying new property value in view mode

4 posts, 1 answers
  1. Brian
    Brian avatar
    17 posts
    Member since:
    Jun 2011

    Posted 22 Feb 2013 Link to this post

    I have the following comboboxcolumn that is bound to a collection of strings.  The DataMemberBinding points to a property in the object model.  This property gets updated in another part of the system, but the comboboxcolumn does not reflect the new value in view mode.  As soon as I click on the field, the combox displays the updated value.  How can I get it to update in view mode?

    <telerik:GridViewComboBoxColumn Header="M"
    DataMemberBinding="{Binding SummaryGroupDetail.MisclassifiedType, Mode=TwoWay, NotifyOnSourceUpdated=True}"
    UniqueName="MisclassifiedType"
    ItemsSourceBinding="{Binding Path=DataContext.MisclassifiedTypes, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
  2. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 25 Feb 2013 Link to this post

    Hello Brian,

    Generally, ItemsSourceBinding is used when the data source for the column is a property from your business objects. For example if the grid is bound to a source of Player objects and the Player class has a collection property Clubs - then you can use ItemsSourceBinding. Otherwise, you should work with ItemsSource instead.
    Considering the exact issue - do you add a new value in the source of the column that should be displayed as the selected one for a particular item of the grid ?  

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Brian
    Brian avatar
    17 posts
    Member since:
    Jun 2011

    Posted 25 Feb 2013 Link to this post

    New values are never added to the list.  It's a fixed set of permitted values for the field.  Similar to a combobox that lists all the states of a country.  I switched form ItemsSourceBinding to ItemsSource and it worked.  Can you point me to any documentation that explains the difference and when to use one instead of another?
  4. Yoan
    Admin
    Yoan avatar
    1182 posts

    Posted 25 Feb 2013 Link to this post

    Hi Brian,

    You can check this help article, where you can find more information about GridViewComboBoxColumn and its most important properties. Also, there is an example that shows how to use the ItemsSourceBinding property.

    I hope this helps.

    Regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top