PropertyGrib and ComboBox

Grids for WPF Forum

Posted 4 years ago by Boulay Sylvain - Staubli
Version: 15.1.0622
Environment: Windows 7 (64-bit)
Avatar

Hi,

I have a problem using the PropertyGrid and a ComboBox with the IDataErrorInfo.

In your example ActiproSoftware.ProductSamples.PropertyGridSamples.QuickStart.CategoryEditors, I implement the IDataErrorInfo on the CommonObject like following:

        public string Error { get; private set; }

        public string this[string columnName]
        {
            get
            {
                return GetErrorCore(columnName);
            }
        }

        private string GetErrorCore(string columnName)
        {
            Error = GetError(columnName);
            return Error;
        }

        protected virtual string GetError(string columnName)
        {
            return null;
        }

 If I set a TracePoint on the get of the this[string columnName] property, I see that this accessor is called 5 times when I modified a property of a combobox (ie:FontStyle) and one time if I modify the property FontSize. So my implementation of the GetError is quite complicated.

How can I deal with that behavior ? Did I do something wrong or is that a bug ?

Thanks a lot for your help

Sylvain

Comments (1)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

No you didn't do anything wrong.  There is a complex hierarchy of objects that get updated on property changes since all of the core property descriptors are wrapped by our data accessors, which get wrapped by property editors, etc.  It appears that in this particular scenario, multiple value changed events are getting raised (through different code paths) and that seems to trigger the IDataErrorInfo calls.  Unfortunately I'm not sure we can alter anything on our end though without potentially introducing other issues.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 14 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.