Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing properties with RefreshProperties.All does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) #13071

Open
sanyappc opened this issue Mar 4, 2025 · 1 comment
Assignees
Labels
🪲 bug Product bug (most likely) 💥 regression-release Regression from a public release
Milestone

Comments

@sanyappc
Copy link

sanyappc commented Mar 4, 2025

.NET version

.net 9

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

.net 8

Issue description

The logic for refreshing the property list when using the [RefreshProperties(RefreshProperties.All)] attribute is broken in .net 9

In .net 8 everything works as expected.

When changing a property, now only the values are refreshed, although the documentation clearly states that using RefreshProperties.All will cause properties to be requeried. Now RefreshProperties.All behaves like RefreshProperties.Repaint

The bug was added with commit dc4314e

Image

Steps to reproduce

Updating the code below from .net 8 to .net 9 causes the GetProperties method to stop being called when changing property A via PropertyGrid

public Form1()
{
    InitializeComponent();
    propertyGrid1.SelectedObject = new SelectedObject();
}

[TypeConverter(typeof(MyTypeConverter))]
public class SelectedObject
{
    private string a;
    private string b;

    [RefreshProperties(RefreshProperties.All)]
    public string A
    {
        get { return a; }
        set { a = value; }
    }

    public string B
    {
        get { return b; }
        set { b = value; }
    }
}

public class MyTypeConverter : TypeConverter
{
    public MyTypeConverter()
        : base() { }

    public override bool GetPropertiesSupported(ITypeDescriptorContext context)
    {
        return true;
    }

    public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
    {
        return base.GetProperties(context, value, attributes) ?? TypeDescriptor.GetProperties(value, attributes);
    }
}
@sanyappc sanyappc added the untriaged The team needs to look at this issue in the next triage label Mar 4, 2025
@sanyappc sanyappc changed the title Changing properties with RefreshProperties.All does not requery the property list of the PropertyGrid in .net 9 Changing properties with RefreshProperties.All does not requery the property list of the PropertyGrid in .net 9 (worked in .net 8) Mar 4, 2025
@sanyappc sanyappc changed the title Changing properties with RefreshProperties.All does not requery the property list of the PropertyGrid in .net 9 (worked in .net 8) Changing properties with RefreshProperties.All does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) Mar 4, 2025
@JeremyKuhne JeremyKuhne self-assigned this Mar 4, 2025
@JeremyKuhne
Copy link
Member

The 9.0 servicing break was #12605.

@JeremyKuhne JeremyKuhne added 🪲 bug Product bug (most likely) 💥 regression-release Regression from a public release and removed untriaged The team needs to look at this issue in the next triage labels Mar 4, 2025
@JeremyKuhne JeremyKuhne added this to the 9.0.4 milestone Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Product bug (most likely) 💥 regression-release Regression from a public release
Projects
None yet
Development

No branches or pull requests

3 participants