Metadata override and base metadata must be of the same type Metadata override and base metadata must be of the same type wpf wpf

Metadata override and base metadata must be of the same type


You need to use FrameworkPropertyMetadata. All elements that ship with WPF that derive from FrameworkElement (and DataGrid does) use it as their metadata.