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
770
Binding column visibility
posted

Is it possible to bind a column's visibility?  eg:

 

<ig:TemplateColumn Width="100" 
         Key="Reference" 
         Visibility="{Binding ShowColumn}">

 

At the moment, it doesn't seem to get the property, nor complain that it's in the wrong place (I assumed it would be on the DataContext rather than attached to an item)

 

Thanks

 

James

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi James, 

    A Column object isn't a Visual element (i.e. a FrameworkElement) so it doesn't participate in DataContext inheritance So in order for you to be able to bind to it, you'd need to set the Source of the Binding to a StaticResource.  

    Then you can bind to that, 

    -SteveZ

Children