This is a migrated thread and some comments may be shown as answers.

DataFormValidationSummary.Errors is no longer settable

3 Answers 98 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 24 Feb 2016, 06:47 PM

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

3 Answers, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 24 Feb 2016, 07:00 PM

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);
   }
  }

0
Accepted
Ivan Ivanov
Telerik team
answered on 29 Feb 2016, 05:14 PM
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
0
Steve
Top achievements
Rank 1
answered on 29 Feb 2016, 05:20 PM
I realized this was the answer after I post.  Thanks for the confirmation!
Tags
DataForm
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Share this question
or