This question is locked. New answers and comments are not allowed.
Hello,
I have a problem involving databinding a GridView that is placed in a RadWindow.
When I create a GridView like this, everything works fine:
As soon as the PropertyChanged-event of the Results is raised, my GridView databinds perfectly. However, when I put the same GridView in a RadWindow and call ShowDialog on the window, the GridView doesn't respond to the NotifyPropertyChanged-event anymore, and my GridView remains empty.
The solution I use now, is to manually listen to the propertychanged event and set the ItemsSource of the GridView:
This works, but of course using Bindings for the ItemsSource would have been much easier. So I was wondering, is this a bug or did I do something wrong?
Greetings
Sodi
I have a problem involving databinding a GridView that is placed in a RadWindow.
When I create a GridView like this, everything works fine:
| <telerikGrid:RadGridView Name="ResultsGrid" ItemsSource="{Binding Results}" AutoGeneratingColumn="ResultsGrid_AutoGeneratingColumn" IsReadOnly="True" VerticalAlignment="Stretch"></telerikGrid:RadGridView> |
As soon as the PropertyChanged-event of the Results is raised, my GridView databinds perfectly. However, when I put the same GridView in a RadWindow and call ShowDialog on the window, the GridView doesn't respond to the NotifyPropertyChanged-event anymore, and my GridView remains empty.
| <telerikNavigation:RadWindow x:Name="ResultsWindow"> |
| <telerikGrid:RadGridView Name="ResultsGrid" ItemsSource="{Binding Results}" AutoGeneratingColumn="ResultsGrid_AutoGeneratingColumn" IsReadOnly="True" VerticalAlignment="Stretch"></telerikGrid:RadGridView> |
| </telerikNavigation:RadWindow> |
The solution I use now, is to manually listen to the propertychanged event and set the ItemsSource of the GridView:
| _viewModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ViewModel_PropertyChanged); |
| ... |
| void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) |
| { |
| if (e.PropertyName == "Results") |
| this.ResultsGrid.ItemsSource = ViewModel.Results; |
| } |
This works, but of course using Bindings for the ItemsSource would have been much easier. So I was wondering, is this a bug or did I do something wrong?
Greetings
Sodi