Hi,
I am receiving the error "Field must be from the same FieldLayout as the record" when binding the XamDataGrid to a list whereby default values have been added in InitializeTemplateAddRecord via SetCellValue, and when editing a datetime cell as the first cell. This occurs when i have assigned datasource to a second list after first being assigned to another list.
I have attached an example of this. In order to reproduce perform the following.
- I have 2 buttons and a grid on a form. One button assigns a List of Cars to the grid, Another button assigns a list of people to the grid.
- Click on the Bind Cars button, the grid is loaded with cars. The Field named 'Colour' is set to the default value of "Blue" for the add new row template. Notice at this point i can happily create a new record by setting ManufactureDate and other field values.
- Click on the Bind People button, the grid is loaded with people. The Field named 'MaritalStatus' is set to the default value of "Single" for the add new row template. Attempt to create a new record by firstly setting the DateOfBirth.
The error "Field must be from the same FieldLayout as the record" is produced.
If all SetCellValue calls are removed from the InitializeTemplateAddRecord event handler, there is no error produced. I either need this error fixed or an alternate method of setting cell value defaults.
This was experienced in 10.2, 10.3 and 11.1
Thanks,
Andrew
Any luck resolving this? I got the same problem and having a hard time coming up with an alternative solution.
Yes, the issue has been resolved by a patch released by Infragistics.
Issue "80117: Error when setting the value of a DateTime cell in AddNewRecord for the first time and a cell of the template is set in InitializeTemplateAddRecord" has been addressed in service release versions WPF_11.1.20111.2026, WPF_10.3.20103.2237, WPF_10.2.20102.2341.
Hi...
I am receiving the error "Field must be from the same FieldLayout as the record" when binding the XamDataGrid to a DataSet with defaultView.
I have one Button on my UI when I click on button then it perform backend (database) operation on selected record mean while if you right click on the grid then it will throw error
"Field must be from the same FieldLayout as the record".
One thing here I mention I use the InfragisticsWPF4.DataPresenter.v13.1