This question is locked. New answers and comments are not allowed.
Hello!
I have a RadGridView and want to display the columns dynamically, so I use a Databinding for my variable in the ViewModel.
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
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:RadGridView.Columns> <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}" /> </telerik:RadGridView.Columns> </telerik:RadGridView> 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