Hi there,
we have a issue with multiple unboundfields in the XamDataGrid.
When using them, and setting the BindingMode on TwoWay it only updates the Cell or ObjectProperty once.
For example:
We have Length as a property of documentline. This is added to the grid as an UnboundField.When adding or editing a documentline we change length from 1 to 4. This is correct and also changed. When we enter the Length field again and fill in for example 5 it changes back to 4 on exit of the field. Everything we have tried doesnt help. We are hoping you can help us.
This is the code we use to add a field to the XamDataGrid:
UnboundField unboundField = new UnboundField(); String fieldName = "Length"; FieldLayout fieldLayout = null; unboundField.Visibility = visibility; if (unboundField.Visibility == Visibility.Hidden) return unboundField; //Always Disabeled!!! One way binding... if (bindingMode == BindingMode.OneWay) unboundField.Settings.AllowEdit = false; //If no FieldLayout exists create one... if (xamDataGrid.FieldLayouts.Count == 0) xamDataGrid.FieldLayouts.Add(new FieldLayout()); if (xamDataGrid.FieldLayouts.Count > 0) fieldLayout = xamDataGrid.FieldLayouts[0]; if (fieldLayout == null) return unboundField; fieldLayout.Settings.AutoGenerateFields = false; //Add field unboundField.Name = fieldName; unboundField.Label = ResourceManager.GetResourceStrByKeyLang(resourceAuthKey); unboundField.ToolTip = unboundField.Label; unboundField.Width = new FieldLength(fieldWitdh); unboundField.BindingPath = new PropertyPath(GetBindingFromResAuthKey(resourceAuthKey)); unboundField.BindingMode = bindingMode; if (editorType != null) unboundField.Settings.EditorType = editorType; else unboundField.Settings.EditorType = typeof(XamTextEditor); fieldLayout.Fields.Add(unboundField);
Our mistake, we found the error.
Marked as solved...
Hello,
Would you be willing to post the solution you found here?
Thank you!