I have dug deep into the Record.cs source code file and found that the DataRecord class has a property named GetDataErrorInfo that returns the record's DataItem as IDataErrorInfo. However, this fails if the the Record's DataItem is a complex object of objects that support IDataErrorInfo. This complex object is the result of a LINQ to Objects query without a Select "clause" to preserve the ability to set the properties in the Objects used to build the query. Again, these objects in the linq query support IDataErrorInfo. The only way to expose the IDataErrorInfo.Error property is to loop the Cells finding UnboundFields and check if each Field's binding source supports IDataErrorInfo. Is this a bug or will the xamDataGrid never support complex binding? Is there another way to bind to multiple related sources so that I do not have to use UnboundFields and complex binding?
Thank You
Devin
Found out how to upload.
Now to recreate what I am stating add a breakpoint to any one of the [Error] Properties that implements IDataErrorInfo.Error in my Data.vb file (it contains 3 data objects). Run the project with debug mode. Change any entry to blank (this is what the validation is looking for). The breakpoint will never be hit.
Now to get the breakpoint to hit, go to the xaml and change each one of the UnboundFields to a Field. Remove the bindingpath and the bindingmode. Change the names to remove the dot notation. Finally change the linq query from this:
Dim myOC = From o In ordersBL Join oi In orderItemsBL On o.id Equals oi.oid Join i In inventoryItemsBL On oi.iid Equals i.id Order By oi.oid
To this:
Dim myOC = From o In ordersBL Join oi In orderItemsBL On o.id Equals oi.oid Join i In inventoryItemsBL On oi.iid Equals i.id Order By oi.oid Select o.id, o.d, o.wc, oi.qty, i.name, i.descr
How would I go uabout uploading a test project? I don't think I should write 300 lines of code in here.
Thanks
Hello Devin,
I have been looking into your description and I cannot say for sure what is case here, since I am not exactly sure what is the data you are using. I was wondering if you could provide me with a class sample of the data object you described, or perhaps a test project, that I can look into further.
Thanks in advance. Looking forward to hearing from you.