Completed
Last Updated: 10 Apr 2019 15:26 by Dimitar
Release R2 2019 (LIB 2019.1.415)
Edwin
Created on: 25 Mar 2019 10:48
Category: GridView
Type: Bug Report
1
RadGridView: OnNotifyPropertyChanged(string propertyName) does not call base.OnNotifyPropertyChanged(string propertyName)

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

2 comments
Dimitar
Posted on: 10 Apr 2019 15:26
Hello, 
 
A Fix will be available in LIB Version 2019.1.415 scheduled for April 15th.

Regards,
Dimitar
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 25 Mar 2019 12:57
Hello, Edwin, 

I have reviewed carefully the described code snippet. Indeed, the basic OnNotifyPropertyChanged method should be called in RadGridView. I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, feel free to use the already found solution with using the new PropertyChangedEventArgs.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.