Hi,
I am using a XamDataGrid to enter a collection of child models in to a single parent model. One of the fields on the grid is only editabled by a button click event. The event is working and the property is changed on the model but the grid does not show the new value. If I make the field editable and assign it a value manually then call the event, the grid will update with the new value.
I tested out different fields and all of them behave this way. I beleive this is due to using UnboundField, which is needed because of the model setup. It seems that the fields don't bind until data has been entered manaully, which in this case never happens. Is there a way to force the UnboundFields to take the values on the model even when the value changes in an events and is not user driven?
Data grid Xaml: <DataPresenter:XamDataGrid DataSource="{Binding Path=RootModel.Child}" IsEnabled="{Binding Path=NewOrExistingEditingEnabled}"> <DataPresenter:XamDataGrid.FieldSettings> <DataPresenter:FieldSettings AllowSummaries="True" AllowEdit="True" /></DataPresenter:XamDataGrid.FieldSettings>
<DataPresenter:UnboundField BindingPath="PrimaryFields.MarkAsDeleted" BindingMode="TwoWay" Label="Deleted"> <DataPresenter:UnboundField.Settings> <DataPresenter:FieldSettings AllowEdit="False" EditorType="Editors:XamCheckEditor" /> </DataPresenter:UnboundField.Settings></DataPresenter:UnboundField>
Event Method: public void Delete (Model parent, int[ ] fooList){ foreach (int i in List) parent.Child[fooList[i]].PrimaryFields.MarkAsDeleted = true;}
Field: Parent.Child.PrimaryFields.MarkAsDeleted
The latest 2009.1 build of WPF should correct this issue. I uninstalled the hot fix they sent and just have 2009.1 installed and its working correctly.
Hello,
Are there any updates on this issue?? I'm seeing the same thing but alse with the name value in the second column...
I reviewed the new sample that you sent and can see the issue. If it is a new row, the value will not update. I even tried setting a DataTrigger on the checkEditor itself, but that still did not even work. It seems that the check editor is not hooked up until you actually edit it yourself. To get this issue resolved, you will have to submit the issue to Developer Support by submitting an issue online or by calling our support help line at Toll Free Phone: 800-231-8588 or Telephone: (609) 448-2000. Once they have the issue, they can submit the sample that you gave me to development so they can have a look at it.
You can reference these forum entries and hopefully this issue will be resolved for you quickly.
Thanks for the response.
My problem is only when a new record is inserted in to the grid. Any new field in a new row only will not update correctly.
This example is perfect to show this. Any field that you enter data in to will update. In this case you can put an id of 3 in the 3rd row of the grid. Clicking the event will make the ID 4 but the check box will not change. The model will change, but the grid never updates. If you make the check box an editable field and assign it a value, clicking the button will flip the flag as expected.
I made a couple small changes to the example to show the issue I am having.
I am not sure what the problem may be. Does your object implement INotifyPropertyChanged? That could be the problem. That interface will allow the grid to know when something on the object was changed. I put together a simple test of what you have explained and have not had an issue with either a bound or unbound field. Please check the attached sample and let me know what you think.
When you set the Binding Path, you are basically in a sence making a bound field. So, when the object that it is bound to changes, the grid should reflect that.
Hope the sample helps you get to the bottom of your issue.