In you example how handling hierarchical dataset you are using predefine classes (Customer, Order and OrderDetails). What should I use to create dynamically and load with data and then bind to datagrid? Please provide example.
Thanks.
Hello,
If you are unable to implement error validation on your underlying data, one possible option would be to mimic error processing and set Visual State of the underlying editor to Invalid whenever the value does not pass the editing.
I have attached a sample illustrating this. In the sample, whenever the value does not pass validation the underlying editor is retrieved and the Tag of the editor is set to the error message and the visual state is set to “InvalidFocused”. In addition, the validation tooltip template is overridden so that the text of the tooltip is set to the tag of the control.
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support
How can I flag the error? Set red border, show message on grid.
Hello Igormezh,
Normally you would implement IDataErrorInfo on the class that the grid is bound for data validation. In the case of a grid bound to a dictionary you would need to implement your data validation logic in the CellExitingEditMode event. You can then cancel the event if the value does not meet your validation criteria by setting e.Cancel = true;
Jason
Your example is throwing a KeyNotFoundException when you try and add a new row.
How can I use validation for empty field, for numeric value and for range when bind of BindableCollection<ObservableDictionary<string, object>> to xamGrid?