Binding for "IsVisible" does not work

2 posts, 0 answers
  1. Richard Koslik
    Richard Koslik avatar
    70 posts
    Member since:
    Apr 2010

    Posted 03 Nov 2010 Link to this post


    I have a RadGridView and want to display the columns dynamically, so I use a Databinding for my variable in the ViewModel.

    <telerik:RadGridView ShowColumnHeaders="False" AutoGenerateColumns="False" 
                         IsBusy="{Binding bIsDataLoading}" 
                         SelectedItem="{Binding SelectedDataItem,Mode=TwoWay}" 
                         ItemsSource="{Binding tab_Data}" Name="grdOverview"  
                         HorizontalAlignment="Left" VerticalAlignment="Top" 
                         Width="640" Height="350" Margin="0,50,0,0">
           <telerik:GridViewDataColumn IsVisible="{Binding bsColumn1}"  
                    DataMemberBinding="{Binding S1}" Width="{Binding iWidthsColumn1}" />
           <telerik:GridViewDataColumn IsVisible="{Binding bsColumn2}" 
                    DataMemberBinding="{Binding S2}" Width="{Binding iWidthsColumn2}" />
           <telerik:GridViewDataColumn IsVisible="False" 
                    DataMemberBinding="{Binding S3}" Width="{Binding iWidthsColumn3}" />

    In the ViewModel I initialize for example "S2=false" and call then "this.OnPropertyChanged(p => p.S2)" for my variable. After that I show the window with the GridView, but the column is still displayed! When I click onto the column the first time the data is deleted, when I click a second time the data gets visible. It looks crazy! If I set the property "IsVisible=false" without a binding the column is not shown and it works.

    I have included a screenshot of my gridview.

    Maybe I am missing something, so that it works.

    Best regards, Richard
  2. Maya
    Maya avatar
    4062 posts

    Posted 08 Nov 2010 Link to this post

    Hi Richard Koslik,

    You may take a look at this forum thread for a reference. 

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top