The function OnNotifyPropertyChanged(string propertyName) in RadGridView.cs does not call the base function of RadControl.
RadGridView.cs
protected override void OnNotifyPropertyChanged(string propertyName)
{
if (propertyName == "AutoSize")
{
if (!this.AutoSize)
{
this.RootElement.StretchHorizontally = true;
this.RootElement.StretchVertically = true;
}
else
{
this.RootElement.StretchHorizontally = false;
this.RootElement.StretchVertically = false;
}
}
}
RadControl.cs
/// <summary>
/// Raises the PropertyChanged event
/// </summary>
/// <param name="propertyName">The name of the property</param>
protected virtual void OnNotifyPropertyChanged(string propertyName)
{
this.OnNotifyPropertyChanged(new PropertyChangedEventArgs(propertyName));
}
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
{
PropertyChangedEventHandler handler1 =
(PropertyChangedEventHandler)this.Events[RadControl.PropertyChangedEventKey];
if (handler1 != null)
{
handler1(this, e);
}
}
Because of this i cannot do the following
RadGridView grid = new RadGridView();
grid.OnNotifyPropertyChanged("mypropertyname");
I currently work around this by doing the following
RadGridView grid = new RadGridView(); grid.OnNotifyPropertyChanged(new PropertyChangedEventArgs("mypropertyname"));
I need this functionality because i have a custom control which is derived from RadGridView and it has a custom property that requires databinding with INotifyPropertyChanged. I cannot implement this interface myself because the grid already does this.
I have checked this in both the 2018.1.220 and 2019.1.219 source.
Kind regards,
Edwin Dirkzwager
CIP Software