Jump to content
  • Advertisement
Sign in to follow this  
orbano

[.net] VS Property Editor Tweak.. help!

This topic is 4146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have a set of controls, with the same interface, having two public properties: DataMember (its a complex class, from which the control takes data to display) Delegate (a control, that works as a "relay" for several controls. It sets their DataMember at once) DataColumn (a simple string, tells the control, which data element to take from DataMember) I want the following: After i set the controls Delegate property (from a dropdown list with the available Delegate controls put on the form), and the DataMember is automatically set, i want to be able to set the DataColumn from a dropdown list, that list the available data elements, the DataMember has. Is there a was to write a class/function, attribute, anything, that tells the VS Property Editor (PropertyGrid) that the DataColumn string field should be displayed with a ComboBox with the following items... ? Thank you in advance!

Share this post


Link to post
Share on other sites
Advertisement
Yes.

There are some classes called, like, PropertyEditor or something along those lines down somplace in System.ComponentModel. So you derive from one of them (they include a list picker - there are tons of them, though) and then attach the class to the property with the Editor attribute.

Its been a while since I worked with this stuff, so its all a little vague. Start with a docs search on the Editor attribute and branch out from there.

What you want to do is pretty simple.

Share this post


Link to post
Share on other sites
Thanks! If you (or some1) could tell me it in more detail, i'd appreciate it! (of course i start diggnig in msdn first. but my last effort was quite useless:))

Share this post


Link to post
Share on other sites
for property grids, you want to look at TypeEditors http://msdn2.microsoft.com/en-us/library/ms171840.aspx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!