DataFormValidationSummary.Errors is no longer settable

4 posts, 1 answers
  1. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 24 Feb Link to this post

    Just installed UI for WPF Q1 217 SP1 and received this error.

    error MC3080: The property 'DataFormValidationSummary.Errors' cannot be set because it does not have an accessible set accessor.

    We have been using the DataFormValidationSummary outside of the DataForm for years.  This is a serious breaking change for us.  Can you provide a work around?

    Thanks in advance,

    Steve

  2. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 24 Feb in reply to Steve Link to this post

    Here is a code snippet from the current source code for DataFormValidationSummary.  It shows that Errors does have a setter.  Can you explain this?

    /// <summary>
      /// Gets the pending validation errors.
      /// </summary>  
      public ObservableCollection<ErrorInfo> Errors
      {
       get
       {
        return (ObservableCollection<ErrorInfo>)this.GetValue(ErrorsProperty);
       }
       private set
       {
        this.SetValue(errorsPropertyKey, value);
       }
      }

  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 29 Feb Link to this post

    Hello Steve,

    I do apologize for the migration difficulties that you had with the mentioned update.
    We decided to make the change as in its previous state it imposed a vulnerability in the current API. Generally, it is not a recommended practice to have publicly settable collection properties as changing the original instance can lead to further problems. 
    The recommended approach while using the new implementation is to add the error instances to the collection exposed by the property. A sample project is attached for your reference. Can you please confirm whether the new logic can fully cover the scenario that you have on your side?

    Regards,
    Ivan Ivanov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 29 Feb in reply to Ivan Ivanov Link to this post

    I realized this was the answer after I post.  Thanks for the confirmation!
Back to Top