I will go straight to your questions.
1. The DataGridTemplateColumn
is a specific type of Column that gets its DataContext
set internally to the data item the row is visualizing. In order to set the desired ViewModel
ad the Command Binding to be working as expected the DataContext
should be set after the control is completely loaded - in the Loaded event for example.
2. For your second issue the DataGrid
is most probably not updating because the collection the ItemsSource is bound to does not inherit and implement the INotifyCollectionChanged
interface - please, check if the collection you are using implements it. Attached you could find a sample that demonstrates the described above approaches - please, notice how the row is removed as expected when the ItemsSource
is bound to an ObservableCollection
Hope this helps.
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?
Telerik Feedback Portal
and vote to affect the priority of the items