Brian wrote:
I really want to use the IDataErrorInfo interface. I'm using it now
in combination with an ErrorProvider and this seems really good.
But the downside: IDataErrorInfo wants to use a string indexer on my
class. No big deal, but now I have a class where I want to use my
own string indexer. This is frustrating.
Do I have to do something funky like add an extra argument to my
indexer? Is there a better way?
The IDataErrorInfo interface is used for runtime databinding info
reporting, it's not used for error info reporting for your own usage.
This means that the bound controls know what to pass to IDataErrorInfo
to retrieve an error message. If you want to use the IDataErrorInfo
interface for something else, you're using it for a different purpose
and then it might well be that it pretty lacks a lot. So for those
purposes, implement your own interface.
FB
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website:
http://www.llblgen.com
My .NET blog:
http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------