Controls and INotifyPropertyChanged

3 posts, 1 answers
  1. Mark
    Mark avatar
    6 posts
    Member since:
    Oct 2008

    Posted 17 Sep 2010 Link to this post


    Most of the Windows Forms controls in Telerik implement the System.ComponentModel.INotifyPropertyChanged interface though I have noticed that it does not seem to fire whenever a property changes value.  I have noticed this in RadTextBox (Text property) and in RadDropDownList (SelectedValue property); I have not checked the other controls. 

    Yes, these controls do have more specific events that fire when their value changes (TextChanged or SelectedValueChanged) but in the case of our project it is simpler to use the INotifyPropertyChanged.PropertyChanged event.

    1) Is it possible to know which control properties do fire the PropertyChanged event?
    2) Are the implementations of INotifyPropertyChanged only designed to work for certain properties?

    I cannot remember but I'm pretty sure previous releases used to fire this event and this only occurred with the latest release.

    Thank you.
  2. Answer
    Stefan avatar
    2891 posts

    Posted 22 Sep 2010 Link to this post

    Hello Mark,

    Thank you for writing.

    Basically, all property changes fire the PropertyChanged event. However, this event is fired at the base element that has this property exposed. Depending on the structure of a RadControl, the properties that you can see exposed at this RadControl may only be shortcuts, but not the original properties. So you should not expect to get the PropertyChanged event fired at the control, but you should expect to get it fired at the element that has the original property exposed. We do not have a certain specification and a list describing which property is a core property at which element since these specifics highly vary on the different purposes (hence structures) of the controls.

    In regards to the RadDropDownList control, generally you should be able to get the PropertyChange fired with SelectedValue arguments at the ListElement:
    public Form1()
        this.radDropDownList1.ListElement.PropertyChanged += new PropertyChangedEventHandler(ListElement_PropertyChanged);
    void ListElement_PropertyChanged(object sender, PropertyChangedEventArgs e)
        if (e.PropertyName == "SelectedValue")
            // do sth here

    However, currently we have an issue which will prevent you from experiencing this behavior. We will address it in the upcoming major release Q3 2010.

    I hope this information answers your questions.

    the Telerik team
    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? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
  4. Mark
    Mark avatar
    6 posts
    Member since:
    Oct 2008

    Posted 28 Sep 2010 Link to this post

    Hi Stefan,

    Thank you for the additional details regarding PropertyChanged. 

    We have decided to alter our code to subscribe to the appropriate event(s) of each control instead of relying on PropertyChanged as a "catch-all" event.  It would definitely be great if any future release would expand on PropertyChanged.

Back to Top