propertygrid

How to define TypeConverter for enumeration drop down in Propertygrid in Visual C++ Winforms?

I would like to create a drop-down in a propertygrid in Visual C++ where I define text for each item of an enumeration. I cannot seem to find any help for this anywhere - all the help seems to be targeted to C# users and I am unable to convert to Visual C++. I believe I need to create a TypeConverter that converts my enumeration to Strin...

PropertyGrid alternatives

I love PropertyGrid, well, at least the concept behind it - use reflection and attributes to edit your objects without writing much UI code. My excitement died out pretty quickly though, the default PropertyGrid shipping with WinForms flat-out sucks. Well, it's fine for editing simple objects and such, but that's as far as it goes. It...

Windows forms: PropertyGrid

Hi, Does setting PropertyGrid.SelectedObject = null; effects the actual object? eg: Button b = new Button(); System.Windows.Forms.PropertyGrid pg = new System.Windows.Forms.PropertyGrid(); pg.SelectedObject = b; pg.SelectedObject = null; What will happen to Button b? will it be null? Thanks & regards, Vishal. ...

property grid shared between two forms

Hi all, Is it possible a property grid could be shared between two forms? Right now, when the grid initializes and shown in a form, everything's fine. But when another form hosting the same grid shown, the grid in the first form disappears. Thanks. ...

PropertyGrid - Possible to have a file/directory selection button next to a property value?

Is it possible to have a file/directory selection button next to a property value in the PropertyGrid? Hitting the button would launch a standard "Open File" or "Select Directory" type of dialog. In a perfect world, this could be done using an Attribute on the SelectedObject's property. ...

C# PropertyGrid DoubleClick event capture

For a project I am working on, I have some values in a PropertyGrid that are many lines long. I want the user to be able to double-click a value in the grid, which will bring up my custom UI window. I already have it set up so that the UI works when the [...] button is clicked, but I also need it to show up directly if any grid item is...

Using a Queue<T> in a PropertyGrid...

I am using a Queue for a property, and it shows it as a collection in the propertygrid. The only issue, is I can't edit anything inside of it, it shows them as just "Objects" and everything is read only. I know Vector2 works fine in a propertygrid because I have a few of those by themselves. I've been googling, and found something abo...

Can PropertyGrid edit any old list of key-value pairs?

All PropertyGrid examples I have seen allow the user to edit a single object, which PropertyGrid scans by reflection. I would like the user to be able to edit, for example, an ini file or a plain-old Dictionary, with one line per key-value pair. Is this possible? ...

How to make System.Drawing.Color both serializable and editable with propertygrid?

Basically i have a settings class like this: class Settings { Color BackgroundColor {get;set;} Color ForegroundColor {get;set;} Color GridColor {get;set;} Color HighlightColor {get;set;} //... etc } And i want to be able to do both - serialize the settings class and edit the colors in propertygrid. The solution I've come ...

c# PropertyGrid and Interface property

Problem: when object is having: class A { public ISomeinterface PropertyName { get; set; } } and then an instance of that class is assigned to propertyGrid.SelectedObject = new A(); then when trying to edit the value of PropertyName, an exception about fail to make instance of ISomeinterface is shown (make sense of course) the que...

Using Shared DLLs and adding UI Attributes to classes

I have a Server/Client project with WCF communications and sharing a dll between both with Contracts and objects: Service | Shared Objects | Client For my Objects I added attributes for use in the propertygrid : [DataMember] [DisplayName("Javascript File Name")] [Description("The browseable path of the Javascript fil...

refresh a collection in propertygrid

hay all. i am using property grid to add or remove an object to a collection. but when the collectioneditor is closed only once the grid refreshes. after adding another object the grid wont get refresh. the collection in a list. i have seen many people with the same problem but no solutions. thansk ...

Is it possible to make a PropertyGrid property ReadOnly unless edited with a custom dialog?

I have a PropertyGrid whose SelectedObject value points to a class with several members like this one: [Editor(typeof(OutputFormatTypeEditor), typeof(UITypeEditor)), ReadOnly(true)] public String OutputFormat { get; set; } With ReadOnly set to true, the user cannot touch the property, even when it is being edited with the OutputFormat...

Is there a way to detect if the user is editing a property in a property grid?

I have a Windows form (.NET 3.5) that contains a propertygrid control. The propertygrid control gets refreshed periodically do display any changes that may have occurred in the class which it represents. I want the refresh to only occur if the user is not currently editing a property in the grid. Is there a way to detect if the user is c...

C# WinForm PropertyGrid - Adding a linklabel in DescriptionAttribute?

Perhaps I'm just searching with the wrong terms, but I can't find any information about this. I'd like to be able to add a link to a pdf file (or help file?) within a property descriptor for a given object property. I'm fairly certain this is supported functionality (I swear I've seen it before) but I can't find any information about h...

Property grid changes focus to other property when .SelectedObject later set to "new object()" and back

I have the following code. When one of the properties value is changed the focus will be jumped to other property- focus changed to "Text" when boolean property was changed, to be specific. Why this is happening? propertyGrid1.SelectedObject = textBox1; void propertyGrid1_PropertyValueChanged(object s, System.Windows.Forms....

Set Value of Property When Delete Key is Pressed in PropertyGrid.

I am currently working on a project that hosts WinForms designer. I am using PropertyGrid to display manipulate properties of the controls that are dropped on the DesignSurface. I have created UITypeEditor's to modify values of my custom controls properties. How can I reset the value of the property to null when Delete key is pressed i...

PropertyGrid displayvaluy length

Hi, I am working on C#.NET. my project i am using smartPropertyGrid Control, i want to set smartPropertyGrid control value length(smartPropertyGrid value should accept only 8 digit). How i can achive? ...

IComponentChangeService events don't fire when Property Value is modified

I am working on a WinForms designer hosting project. All controls that will be dropped on the DesignSurface are custom controls that inherit from existing controls. My DropDownListControl: [Serializable] [ToolboxBitmap(typeof(System.Web.UI.WebControls.DropDownList))] [ListControlSerializerAttribute("asp", "DropDownList")] public clas...

InvalidCastException casting object to its own type

I'm currently completely baffled by the problem I'm having. I'm writing a plug-in for another application that provides a public .NET API. I've created a class named Room and I am using a PropertyGrid to allow users to see and edit the properties of the Room instances. A few properties are restricted to a set of standard values. Thus I a...