Hi,
I've a XamDataGrid with a bound DataContext (A List).
I want to make (For now, the count property of the list) the UnboundField showing this property.
So, I've created this binding:
Binding Path=DataContext.Count,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igWPF:XamDataGrid}}}
Unfortunately, I got this binding error: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Infragistics.Windows.DataPresenter.XamDataGrid', AncestorLevel='1''. BindingExpression:Path=DataContext.Count; DataItem=null; target element is 'ValueHolderWithDataContext' (HashCode=62236609); target property is 'Value' (type 'Object')
Did I miss something? I think, It must be possible to bind an UnboundField out of the field scope...
Hi
I am sorry but I am not sure I follow the scenario. Can you provide more information or a sample application ?
The XDG unbound field is bound to a list of objects that have count property ? Or the idea is to bind the unbound field to the list's count property because in that case all the cells will have the same value ?
Thanks,
Slavi
in this case every cell have the same value.because every cell is bound to the list's count property.
But this would be something I could build on...
Can you try this binding:
<igDP:UnboundField Label="Count" Binding="{Binding Path=Cell.DataPresenter.DataContext.Count, RelativeSource={RelativeSource Self}}"/>
And let me know if that is what you were looking for?
-Slavi
Thank you,
this is exactly what I want to know!