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

PropertyGrid Bug Fix: when an enum is changed, PropertyChanged EventArgs returns the enum type, which should be the enum variable name. #475

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

xzqsr
Copy link
Contributor

@xzqsr xzqsr commented Dec 2, 2024

For example,

public enum Fruit
{
    Apple,
    Orange,
}

public Fruit Selected1 { get; set; } 
public Fruit Selected2 { get; set; } 

private void PropertyGrid_PropertyChanged(object sender, GenericEventArgs<string> e)
{
    Debug.WriteLine(e.Data); // the output is "Fruit", however it should be "Selected1", "Selected2", ...
}

At PropertyGrid.cs line 690, I changed FireChanged(enumType.Name) to FireChanged(record.Name). And then it worked well!

…rgs returns the enum type, which should be the enum variable name.
@rds1983 rds1983 merged commit 51b52cb into rds1983:master Dec 2, 2024
1 check passed
@rds1983
Copy link
Owner

rds1983 commented Dec 2, 2024

Thanks @xzqsr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants