theusch Posted November 10, 2010 Posted November 10, 2010 I'm pretty much a .NET newbie, but am working through things OK. I'd like to create a panel that looks a lot like the Properties window in Studio. A list of "property" names, and an associated field to enter/modify the value. Example: I might have a list of products. When one is selected, I want to have this Property-like window have lines like Name PROD1NAME Cost 1.23 Color Green etc. I've seen the facility in other apps that look like they are .NET. I can't see how to coerce ListView or GridView or DataView or xxxView to create this. Is there a ready-made control for this? Or can someone point me to an example of a "Property window" implementation? Alphabetic/Categorized not important. C# FWIW. Thanks. Quote
theusch Posted November 10, 2010 Author Posted November 10, 2010 I may have found my answer in a search of these Forums: PropertyGrid. http://www.xtremedotnettalk.com/showthread.php?t=76280&highlight=property+window Exploring further on how to use it... Quote
Leaders snarfblam Posted November 10, 2010 Leaders Posted November 10, 2010 You might want to look into something like this CodeProject article. You can get a lot of control over the property grid by using custom TypeDescriptors and PropertyDescriptors. Quote [sIGPIC]e[/sIGPIC]
theusch Posted November 11, 2010 Author Posted November 11, 2010 Thanks, snarfy. I'll dig into that, and see if it addresses the next issue that I have with using PropertyGrid. Say I have a property that is a small integer. No problem, then. But I want to limit the allowed values to, say, 1-32. Where do I do the limiting? In the set{}? So much to learn... Quote
Leaders snarfblam Posted November 11, 2010 Leaders Posted November 11, 2010 If an exception occurs in your property's set accessor, the property grid will show the user an error dialog with the exception's message. This means that in your set accessor you can check a value to make sure it is in range, and throw an exception with the appropriate message if the value is invalid or out of range. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.