tihsin Posted October 2, 2003 Posted October 2, 2003 PropertyGrid support for Collections (Divil ???) Hi, I am extending on a comboBoX control to write my own control. This new control has a property that is a Collection of string ... I want to display this in the prperty grid ... so I added the [browsable] attribute to the property in the extended class ... the collection is displayed in the property grid ... but when i click on the ellipsis (...) in the property grid and try to add a new item in the design mode ... it doesn't allow me to do so ... sometimes, the Add button is disabled ... some other times "Add" is enabled ... but when the object gets added ... it cant be edited ... and throws and exception ... anyone tried this before ? Thanks, Nish Quote
*Gurus* divil Posted October 2, 2003 *Gurus* Posted October 2, 2003 If you want a collection to be treated as an array of strings by Visual Studio like the ListBox's Items property is, apply this attribute to it: Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor)) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
tihsin Posted October 3, 2003 Author Posted October 3, 2003 UNRESOLVED ... Hi Divil, Actually I have a NameValueCollection ... so i need another kind of collection editor ... i already got the stringcollectioneditor working, but its not enough when using a namevaluecollection in the control ... Thanks, Nish Quote
*Experts* Volte Posted October 3, 2003 *Experts* Posted October 3, 2003 You will more than likely need to design your own editor form to do that. I don't think there's a built in one. Quote
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.