.Net Controls – PropertyGrid

There has been a lot of discussion over the pain of using the DataGrid in .NET 1.x. This pain and the endless sample work-around code to accomplish desired behaviors prompted Microsoft to release the GridView control in .NET 2.0. One control that I would like to add the list of "looks nice but is a pain to work with" is the PropertyGrid. It looks really nice and could have a mess of highly useful functionality in a UI, but you just have to glean so much knowledge from disparate and incomplete sources or build in so much customization that feels like a hack, that I would add my vote to this being one control that deserves rework.
This was all prompted by my showing a coworker some attributes I added to one of our application’s custom controls to enable design-time control over the property and behavior of the control. All custom controls display their properties in the VS IDE within the context of a property grid (I mean, what else would you call it when you right click a control and select ‘Properties’?!?). So, I added some attributes to the property to get it to behave, at design time, the way I wanted it to. I was asked how I knew what attributes I could put on it to make it work properly. The answer is that I had the experience (read "pain") of working with a property grid on another project where I did some research into the PropertyGrid control that came into play.
For anyone interested, here’s a few links that I use when dealing with the PropertyGrid control. My advice would be to stay away (ever notice that properties displayed in the PropertyGrid don’t contain spaces? Yeah, that’s a limitation of using reflection to glean a property name and not providing an attribute capable of overriding that behavior… how irritating!)

Consider this your warning… run… run far away!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s