Print Page | Close Window

IDataErrorInfo

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=104
Printed Date: 11-Jun-2026 at 10:35pm


Topic: IDataErrorInfo
Posted By: Yaron
Subject: IDataErrorInfo
Date Posted: 04-Jul-2007 at 10:15am
Simple question
 
The new version is implementing IDataErrorInfo, I am using the implementation described in the Verification tutorials (in the BaseEntity). I now get a VS warning that there is already an implementation in the Entity Base object.
My question is, How do I activate the built-in implementation or alternatively,supress the warnings?
 
Thanks



Replies:
Posted By: eileenv
Date Posted: 06-Jul-2007 at 12:40pm
  • The compilation warning occurs in VB only (not C#).

  • If you intend to reimplement the interface member, code in your derived class accesses the reimplemented member unless you use the http://msdn2.microsoft.com/en-us/library/dzfhkk01%28VS.80%29.aspx - MyBase keyword to access the base class implementation.

  • For information on hiding warnings or treating warnings as errors, see http://msdn2.microsoft.com/en-us/library/3y20cc1z%28VS.80%29.aspx - Configuring Warnings in Visual Basic .

     


Posted By: Yaron
Date Posted: 06-Jul-2007 at 4:31pm

OK, First; what I am attempting to achieve is, displaying the verifier results on the UI (error bullets). so now I got 2 questions.

a: Can it be achieved with the new base implementation, if so then how?
b; Can you please refrase the middle part, I totaly lost you there.


Posted By: eileenv
Date Posted: 06-Jul-2007 at 5:30pm
Even prior to the new base implementation, you should have been able to see verifier results displayed in UI with error bullets, if you were using .NET or DevExpress. The reason why IDataErrorInfo was implemented in 3.5.2.2 was to support Infragistics grid users.
 
I believe the Verification tutorial application implements its own IDataErrorInfo because it is doing extra things such as caching VerifierResults. Caching results is not implemented in the base implementation.
 
Rephrase of 2nd bullet: If you implement IDataErrorInfo in your own app, then the base implementation will be ignored unless you use the MyBase keyword to access it.


Posted By: Yaron
Date Posted: 07-Jul-2007 at 2:22am

OK, I looked at suppressing warnings, hardly the solution as it will suppress other warnings aswell which  I realy like. Is there a way to maybe 'force' the Base method to use the value returned from the cache, I also looked for the MyBase option, I don't seem to find the method which implement it (maybe a simple code example will save alot of questions).

Thanks


Posted By: eileenv
Date Posted: 10-Jul-2007 at 10:13am

In a forthcoming release, we will provide users the ability to override the base implementation of the IDataErrorInfo methods. This should make it easier for you to provide your own custom implementation without having to explicitly implement the IDataErrorInfo interface in your own class. Hope this helps. 



Posted By: Yaron
Date Posted: 10-Jul-2007 at 11:50am
Yes, Thanks. that will do it


Posted By: SimonC
Date Posted: 14-Aug-2007 at 6:49am
Could you please point me to the doco on how to use the IDataErrorInfo features of IdeaBlade?


Posted By: eileenv
Date Posted: 21-Aug-2007 at 3:26pm
IdeaBlade.Persistence.Entity provides 2 overridable methods if you want to replace the base implementation of the corresponding IDataErrorInfo methods. These are:

    /// <summary>
    /// Returns an error message indicating what is wrong with this entity.
    /// </summary>
    /// <returns>
    /// An error message indicating what is wrong with this entity.
    /// The default is an empty string ("").
    ///</returns>

    protected virtual String GetDataErrorInfo(); // the base implementation simply returns the RowError

    /// <summary>
    /// Returns error message for the property with the given name.
    /// </summary>
    /// <param name="pPropertyName">The name of the property whose error message to get.</param>
    /// <returns>
    /// The error message for the property. The default is an empty string ("").
    /// </returns>

    protected virtual String GetDataErrorInfo(String pPropertyName); // the base implementation simply returns the ColumnError



Print Page | Close Window