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
420
XamDataGrid UnboundField - Binding UpdateSourceTrigger not being set
posted

Hi,

I am adding UnboundFields onto my XamDataGrid from code, and setting the binding in code as per below:

 

   UnboundField unboundField = new UnboundField()
                    {
                        Name = "MyFieldName",
                        BindingRetentionMode = BindingRetentionMode.AutoRelease,
                        Binding = new Binding()
                            {
                                Path = new PropertyPath("MyPropertyPath"),
                                Mode = BindingMode.TwoWay,
                                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                                NotifyOnValidationError = true,
                                ValidatesOnDataErrors = true
                            }                        
                    };
 
                FieldSettings fieldSettings = new FieldSettings()
                    {
                        EditAsType = typeof(string),                    
			};
  
                unboundField.Settings = fieldSettings;
                defaultFieldLayout.Fields.Add(unboundField);

 

 

As you can see, i have set the UpdateSourceTrigger to "PropertyChanged". However, when I edit one of the values in the cells on the XamDataGrid, my bound property (on my viewmodel) does not update until I leave the cell. So, essentially, the UpdateSourceTrigger being exhibited is "LostFocus", even when i have set it to "PropertyChanged".

Can anyone please suggest why this is the case?

Thanks,

Phil