Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
490
Updating style resets new record row
posted

Hello,

I have a "add new record" row.  The first two columns of the grid are comboBoxes, and are bound to a list, for example:

myField.Settings.EditorType = typeof(XamComboEditor)

var style = new Style(typeof(XamComboEditor));

style.Setters.Add(new Setter(XamComboEditor.ItemsSource, dataContext.MyValues));

myField.Settings.EditorStyle = style;

 

I want the comboBox items in the second field to change depending on the value selected in the first field when editing the new record row.  I update the datasource correctly in the EditModeEnding event handler, but the second field's comboBox is not updated unless I reset the style (recreate the style from scratch).  But, when I do that, the value selected in the first comboBox is cleared?

What am I doing wrong?

Parents
No Data
Reply
  • 115
    Suggested Answer
    posted

    Meanwhile, please make sure the ItemSources (dataContext.MyValues) are ObservableCollection, otherwise the control won't auto-refresh when the collection change.

    Thanks

    Aldrick

Children
No Data