Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
705
Bind an unbound field to its grid
posted

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...