DynamicResource in Column not updating

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    78 posts
    Member since:
    Apr 2013

    Posted 04 Jul 2016 Link to this post

    I have a GridViewColumn where the IsVisible property is connected to a DynamicResource "ShowColumn". When I click on the Button, the value of the "ShowColumn" resource is negated. While the Content of the Button is updated, the IsVisible property of the column does not change.

    How can I achieve that the column is hidden/shown when the resource value changes? The mechanism is part of a larger framework, that does not support direct binding to a ViewModel as the resources are dynamically created as needed and the values are inherited from higher levels.

        <system:Boolean x:Key="ShowColumn">True</system:Boolean>
        <Button x:Name="Button" Content="{DynamicResource ShowColumn}" Click="ShowHideClick" />
        <telerik:RadGridView AutoGenerateColumns="False">
                <telerik:GridViewDataColumn Header="Foo" IsVisible="{DynamicResource ShowColumn}" />
  2. Dilyan Traykov
    Dilyan Traykov avatar
    603 posts

    Posted 07 Jul 2016 Link to this post

    Hello Alexander,

    I'm attaching a sample project where I've followed the approach demonstrated in this helpful article to achieve the desired behavior.

    Please have a look at it and let me know if it would work for you.

    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top