uitypeeditor

UITypeEditor and IExtenderProvider

I have an extender (IExtenderProvider) which extends certain types of controls with additional properties. For one of these properties, I have written a UITypeEditor. So far, all works just fine. The extender also has a couple of properties itself, which I am trying to use as a sort of default for the UITypeEditor. What I want to do ...

ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor

I'm trying to get an overall understanding of how you use ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor to change how a PropertyGrid displays and interfaces with an object. Can someone tell me if this is right, or if I missed any major concepts or points? I'm really just trying to understand why and whe...

How do I inject a custom UITypeEditor for all properties of a closed-source type?

I want to avoid placing an EditorAttribute on every instance of a certain type that I've written a custom UITypeEditor for. I can't place an EditorAttribute on the type because I can't modify the source. I have a reference to the only PropertyGrid instance that will be used. Can I tell a PropertyGrid instance (or all instances) to u...

Passing objects to a UITypeEditor

I am currently hoping to use a PropertyGrid to allow users to edit some of my classes, however I've hit a wall with passing objects to the UITypeEditor(s) they use. When the user presses the drop down I want to show a listbox of already loaded textures to choose from, if they want to use a texture the application hasn't loaded yet they c...

How to implement Auto-Complete with a StandardValuesCollection on a PropertyGrid

I have a property on an object whose custom TypeConverter specifies an exclusive StandardValuesCollection (let's say "Foo" and "Bar"), so that when editing this property via a PropertyGrid, a drop-down list of these values is displayed. I would also like to be able to directly type in the field on the PropertyGrid, and have it auto-comp...

Can I make the default collection editor and/or a custom UIEditor envoke the set accessor for a property?

I'm writing a plug-in for an application where I have a custom class that attributes the native objects of the program. The API allows me to read and write keyed strings directly to and from the objects in the native file. So rather then reading and writing to private fields in the Get and Set accessors of each property I'm reading and w...

Anyone have a UITypeEditor that picks System.Type instances?

I am busy writing a CodeSmith template that has one of its properties as type System.Type. I want to be able to select the type using a UI that picks the assembly, loads the assembly and then displays the types that are available in that assembly. I can then go and pick one of the types. Has anyone encountered or written code that does ...

Design-time editor support for controls collection

I'd like to add a property which represents a collection of controls to a component and have a collection editor with which I can easily select the controls that belong to the collection. VS does almost what I want automatically with the following code: Private _controls As New List(Of Control) <DesignerSerializationVisibility(D...

How do I find the calling PropertyGrid instance from a UITypeEditor?

I need a reference to the PropertyGrid instance which has called my UITypeEditor. If you care to know why: I have a Control which needs to receive a delegate from a property being edited, so that the next action performed in said Control will fire the delegate with some Control-specific information. I don't want to add a reference to ...

From a UITypeEditor, retreive an attribute applied to the parent of a property in .net

It's not quite as simple as the title says but I hope you understand. Consider this scenario: Class MyClass Property SubProp1 End Property -TypeEditor(whatever)- Property SubProp2 End Property End Class Class MyButton Inherits Button -MyCustomAttribute- Property MC as MyClass End Property End ...

Copy Paste is Disabled in Property Grid

Hi All, I have a FileNameEditor inside a property grid, which has a few entries like Main File : "C:\blah1" Sec File: "C:\blah2" and so on. My problem is that I cannot copy and paste from one property entry to another, and I cannot type in the fields manually as well. Is there a specific property that will enable editing inside the...

UITypeEditor and readonly reference type properties in .Net, WinForms

I thought I had type editors and converters nailed until I tried to persist a Readonly Reference type property after editing it in a UITypeEditor. In my UITypeEditor, because I'm working with a read only property, I'm careful to pass back the original value (after updating the relevant sub property). This change is reflected immediatel...

PropertyGrid PaintValue problem: How to remove (and paint outside) the standard rectangle?

This might be a straightforward question, even though I haven't found an easy solution to it: I've implemented my custom UITypeEditor with the sole purpose of adding a PaintValue to bools. For the sake of the discussion, let's assume that PaintValue will either paint a checked or unchecked radiobutton. Question 1: Now, here's the prob...

Insert custom TypeConverter on a property at runtime, from inside a custom UITypeEditor

I've created a custom UITypeEditor. Can I possibly insert an attribute that also attaches a TypeConverter to my property from inside the UITypeEditor class? I've tried the following, but nothing happens, no matter how I twist and turn it: Attribute[] newAttributes = new Attribute[1]; newAttributes[0] = new TypeConverterAttribute(type...

Accessing additional context data in EditValue of UITypeEditor

I'm tweaking a WinForms application. This application has a Form that contains a PropertyGrid. An object is assigned to the SelectedObject property so that the property grid displays the properties for the object. The type of the object assigned has a property that carries an EditorAttribute specifying a UITypeEditor. This implementa...

Is there an existing PropertyGrid UITypeEditor for type "ChartColorPalette" ?

Hi, I'm trying to write a simple property grid to allow the users to modify the colours of a Chart. By default, a Chart has a "Palette" property, which is of the enumeration type "ChartColorPalette". If the object which underlies my property grid also has a "Palette" property of the same type, I get the drop-down list of possible values...

Designer-editing DataSource property of a DataGridView within a UserControl

I have a custom UserControl that contains several child controls, amongst which is a DataGridView. I don't want to EnableDesignMode for any of the child controls, but instead have exposed and serialized their properties as needed. I'm stuck on DataGridView's DataSource property. Do I need to make a custom UITypeEditor and use reflection...

Property setter not getting called with CollectionEditor

I have a custom control that has an Items property. I Have applied an EditorAttribute with a UITypeEditor of type CollectionEditor. Collection Type: [Serializable] [Editor(typeof(CollectionEditor), typeof(UITypeEditor))] public class ListItemsCollection : CollectionBase { // methods } Property Declaration In The Control: pri...

Why is the UITypeEditor "DateTimeEditor" not visible in the object browser ?

Hi, I'm writing a custom control (using VS2010 & C#) and it has a property which is a nullable datetime. Why is it that, when defining my property, I can write this... [Editor("System.ComponentModel.Design.DateTimeEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] public D...

How can I save the values entered at design time for a complex property?

I'm still learning the ropes when it comes to implementing custom editors for complex properties at design time. As a simple starting point, I'm trying to enable design-time editing of a property of type ICollection<string>. What I've done so far is: Wrote a StringsEditor class, which derives from UITypeEditor and displays a drop-dow...