I have a grid that has a couple of UnboundColumns in it. I notice that when I turn on conditional formatting I will see a bunch of errors in the output window like the one below whenever I scroll. Scrolling is kind of slow on this grid and I am wonding if this is why.
System.Windows.Data Error: 40 : BindingExpression path error: 'RowData' property not found on 'object' 'MyObj' (HashCode=165440600)'. BindingExpression:Path=RowData; DataItem='MyObj' (HashCode=165440600); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
I also notice a similar error if the UnboundColumn is the first column and deferred scrolling is turned on. I will see something like this
System.Windows.Data Error: 40 : BindingExpression path error: 'Test' property not found on 'object' ''MyObj' (HashCode=711488479)'. BindingExpression:Path=Template; DataItem='MyObj' (HashCode=711488479); target element is 'ScrollTipInfo' (Name=''); target property is 'FirstColumnValue' (type 'Object')
It seems it is looking for the Key of my UnboundColumn (which is "Test" in this case) on my object. Obviously this will not be there since this is an unbound field.
Hello John,
I have been looking into your description and wasn’t able to replicate the same behavior. I was wondering if you could attach the project you have witnessed this in, so I can properly investigate the cause.
Looking forward to hearing from you.
Here is a sample that illustrates this. Remember to look for the binding expression errors in the output window.
I am just checking if you need any further assistance on the matter.
Hi John,
Thanks for the sample. I have been looking through the code and was able to find what actually causes the errors. Since the XamGrid recycles its visual elements there are a couple of places when even if the binding is working properly we have explicitly cleared the DataContext in order to prevent any memory leaks (e.g. when a Control is detached from its logical Cell item and we need to make sure it is properly disposed of by the CG). By default WPF prevent setting the DataContext to null to display such errors, however in the case when the DepndencyProperty is cleared the errors are shown as usual.
Please let me know, if I can be of any further assistance on the matter.