Hi,
I am trying to override the metadata of SfDataGrid with following code:
public class AdvancedGrid : SfDataGrid
…..
ItemsSourceProperty.OverrideMetadata(typeof(AdvancedGrid), new FrameworkPropertyMetadata(OnItemsSourceChanged));
….
private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is AdvancedGrid grid)
{
grid.HandleItemsSourceChanged(e.OldValue, e.NewValue);
}
}
Please note I have triedPropertyMetadata and UIPropertyMetadata too for passing in metadata details.
Everytime I am ending in exception:
{"Metadata override and base metadata must be of the same type or derived type."}