This is a migrated thread and some comments may be shown as answers.

ComboBox Column not displaying new property value in view mode

3 Answers 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 22 Feb 2013, 10:21 PM

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

3 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 25 Feb 2013, 08:18 AM
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.

0
Brian
Top achievements
Rank 1
answered on 25 Feb 2013, 11:23 AM
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?
0
Yoan
Telerik team
answered on 25 Feb 2013, 02:14 PM
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.

Tags
GridView
Asked by
Brian
Top achievements
Rank 1
Answers by
Maya
Telerik team
Brian
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or