I Have a GridView bound to a ItemsSource and I'm using mvvm. The problem is when I click "Insert" and/or "Click here to add new item" nothing happens. I can edit the data in the rows and delete row and then grid updates. But not insert new rows.
WPF Code:
In my model I have this kind of code:
ValidatedViewModelBase implements IDataErrorInfo and ViewModelBase that implements INotifyPropertyChanged and IDisposable
Is there something wrong with my view model+
Best Regards
Rune
WPF Code:
<telerik:RadGridView ItemsSource="{Binding WellCompletionEvaluation.CompletionItems}" AutoGenerateColumns="False" CanUserInsertRows="True" Grid.Row="24" Grid.Column="0" Grid.ColumnSpan="6" MinHeight="200" MaxHeight="500" ShowInsertRow="True" ShowGroupPanel="False" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed">In my model I have this kind of code:
public class WellCompletionEvaluationViewModel : ValidatedViewModelBase { private readonly JobInfoOperationWellCompletionEvaluation model; public ObservableCollection<WellCompletionEvaluationCompletionItemsViewModel> CompletionItems { get; private set; } public WellCompletionEvaluationViewModel(JobInfoOperationWellCompletionEvaluation model) { this.model = model; WTConfiguration = new WellCompletionEvaluationWTConfigurationViewModel(model.WTConfiguration); this.CompletionItems = new ObservableCollection<WellCompletionEvaluationCompletionItemsViewModel>( from p in this.model.completionItems select new WellCompletionEvaluationCompletionItemsViewModel(p)); } public JobInfoOperationWellCompletionEvaluation Model { get { return this.model; } } public WellCompletionEvaluationWTConfigurationViewModel WTConfiguration { get; set; }}ValidatedViewModelBase implements IDataErrorInfo and ViewModelBase that implements INotifyPropertyChanged and IDisposable
Is there something wrong with my view model+
Best Regards
Rune