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

Parents
No Data
Reply
  • 890
    posted

    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

Children