PropertyGrid problem

J

John Brown

Hi there,

I've created an expandable "PropertyGrid" control that initially looks like this when fully expanded (you'll need a fixed-space font in your news-reader to see it properly aligned):

-Name
-Dimensions 10,20
Width 10
Length 20


As soon as I type in a name for the "Name" property however and press <Enter>, the grid then looks like this:


-Name Whatever
+Dimensions 10,20
Width 10
Length 20

Notice the "+" that now appears beside the "Dimensions" property. The grid automatically closed the "Dimensions" property IOW (why?) but didn't clear out the "Width" and "Length" beneath it. It appears to be a cosmetic problem only since if I call "PropertyGrid.Refresh()" it does clear it. Does anyone know what's going on here. I don't see why it should close "Dimensions" in the first place but even if it does, why isn't it clearing out the "Width" and "Length" rows. Thanks.
 
S

Stoitcho Goutsev \(100\)

Try to apply RefreshPropertiesAttribute attribute to your property. This will trigger refreshing of the property grid when its value changes.


--
HTH
Stoitcho Goutsev (100)
Hi there,

I've created an expandable "PropertyGrid" control that initially looks like this when fully expanded (you'll need a fixed-space font in your news-reader to see it properly aligned):

-Name
-Dimensions 10,20
Width 10
Length 20


As soon as I type in a name for the "Name" property however and press <Enter>, the grid then looks like this:


-Name Whatever
+Dimensions 10,20
Width 10
Length 20

Notice the "+" that now appears beside the "Dimensions" property. The grid automatically closed the "Dimensions" property IOW (why?) but didn't clear out the "Width" and "Length" beneath it. It appears to be a cosmetic problem only since if I call "PropertyGrid.Refresh()" it does clear it. Does anyone know what's going on here. I don't see why it should close "Dimensions" in the first place but even if it does, why isn't it clearing out the "Width" and "Length" rows. Thanks.
 
J

John Brown

Try to apply RefreshPropertiesAttribute attribute to your property.
This will trigger refreshing of the property grid when its value changes.

Thanks. I since discovered that which makes life easier than invoking "PropertyGrid.Refresh()". I'm still not sure why it collapses "Dimensions" in the first place however. If it's not a bug then it's certainly a questionable design decision (not ergonomically correct IMO). At the very least the grid should refresh itself. Anyway, thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top