hi,
i want to bind the IsHidden property of a sfdatagrid columns to a property in my viewmodel,
based on this page it's possible :
https://www.syncfusion.com/kb/2476/how-to-bind-the-gridcolumn-ishidden-property-to-property-in-viewmodel
here is my markup :
<Syncfusion:GridTextColumn HeaderText="Début" MappingName="ORDD_START_DATE"
IsHidden="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:TestVisibility}},Path=DataContext.IsHidden}"/>
but it didn't work , in the output window i have this message
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='CardioOne.Tests.TestVisibility', AncestorLevel='1''. BindingExpression:Path=DataContext.IsHidden; DataItem=null; target element is 'GridTextColumn' (HashCode=18580737); target property is 'IsHidden' (type 'Boolean')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='CardioOne.Tests.TestVisibility', AncestorLevel='1''. BindingExpression:Path=DataContext.IsHidden; DataItem=null; target element is 'GridTextColumn' (HashCode=4566824); target property is 'IsHidden' (type 'Boolean')
i am using the latest version (16.1460.0.32)
thanks for your help .