How to hide or show a GridViewDataColumn

2 posts, 0 answers
  1. Jerry
    Jerry avatar
    7 posts
    Member since:
    Mar 2013

    Posted 22 Mar Link to this post

    I have a RadGridView in my Silverlight application. I am using MVVM with this application.

    I would like to show or hide a GridViewDataColumn column based on a bool property in my Model/ViewModel called ShowAuditColumn.

    This works:

    <controls:GridViewDataColumn IsVisible="False"/>


    But I'd like to use the following. But nothing happens. Should the following work?

    <controls:GridViewDataColumn IsVisible="{Binding Model.ShowAuditColumn}"/>


    How can I hide of show a column and bind it to a bool property?


  2. Martin Vatev
    Martin Vatev avatar
    74 posts

    Posted 25 Mar Link to this post

    Hello Jerry,

    For your convenience, I prepared an example to demonstrate how to achieve the desired behavior. Please take a look at the implementation and consider how this approach fits your scenario.

    You may take a look at this forum thread for more detailed information on the matter

    I hope that this helps. Should you have any other questions, do not hesitate to contact us.

    Martin Vatev
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top