I have a page with two controls, datagrid and data format.
In a datagrid, I have a list of all the objects of a particular class. When the user selects an item in a datagrid, the data form is loaded with the selected object.
dataForm.CurrentItem = view.CurrentItem; view is a PagedCollectionView that contains only the selected item.
My problem is that when setting the currenitem property of the data form, if I use only the PagedCollectionView (view) without .CurrentItem, I lose validation in the data form. All required fields are not considered as required. If I use pcv.CurrentItem as my data form, then checking CurrentItem works fine, but then another problem occurs.
When I use the current PagedCollectionView element as the current data element:
The user selects an element in a datagrid, and the object is loaded in the data form accurately. If the user changes a specific value in any of the text fields of the data form and then selects another element to load the data form, the following error occurs:
"It is not possible to change the currency if the item has validation errors or it is being edited and AutoCommit is false. Set the ItemsSource to ICollectionView to manage the currency instead." I do not use the search properties of the data form, and I have my own save button in the form.
I would be grateful for any help, this is my first Silverlight project that I am working on.
Change I used dataform.CommitEdit when changing the current value of dataform. One thing that this did not allow is that if there is a validation error in the form, a currency error occurs. In any case, to get around this. AutoEdit is true and AutoCommit is false for the data form
source share