propertygrid

How to use the property grid in a form to edit any Type.

I have an App where I'd like to be able to edit any type (font, colour, point etc.) at run time and use any of the .Net default type editors. (e.g., font/ colour picker). Rather than re-invent the wheel, I decided to use the property grid control. If I pass an object of, say font, to the grid, it lists all the fields separately, with n...

Getting Contents of PropertyGrid?

Hi Guys, I'm new to C#, long time C++ programmer, im just wondering once initalising a propertygrid using .selectedObjects. Is there a way to get contents of the current values in the propertygrid. Ben ...

.NET PropertyGrid Collection Editor and List<T>

I'm using the PropertyGrid control in a WinForms application. The window itself binds to a class that contains a list of objects. While I'd prefer it if the grid just expanded and let the user modify the items like a tree-view, I'll settle for the collection editor if it will stop listing the members as "Roswell.Windows.Command.Model" (t...

Converting List<MyClass> Property into PropertyGrid compatible property entries in c#

I have a base class with a number of properties. Included in this is a list of extended properties with metadata. This is a List of a custom class containing DisplayName, Description, Name, Type & Value properties to help the PropertyGrid along. The desired end result would be the PropertyGrid showing my base class properties merged wit...

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...

WPF "Magic" in a PropertyGrid Control

I started a hobby project to learn about WPF and in my reasearch i stumpled upon this WPF PropertyGrid http://www.codeplex.com/wpg I downloaded the source from http://wpg.codeplex.com/SourceControl/ListDownloadableCommits.aspx , And started browsing through it, looks cool, and works. But for the life of me, I can't figure out HOW it wor...

How do I add PropertyDescriptors to a class rather then override them?

If I have a class that implements ICustomTypeDescriptor I can override the GetProperties() method to completely replace all the properties of the class with my custom PropertyDescriptors. But what if i want to keep the existing properties of the class and append additional properties to the class? Is there a way to return a set of cust...

.NET Property Grid - setting Browsable (bool) using App.config

Hello I would like to be able to set the visibility of a property on my property grid using App.config. I have tried : [Browsable(bool.Parse(Sytem.Configuration.ConfigurationSettings.AppSettings["testBool"]))] However Visual Studio 2008 would give me an error "An attribute argument must be a constant expression, typeof expression or a...

Add property-level attributes dynamically using TypeDescriptor for PropertyGrid

Hi All, I want to add attributes (like Browsable(false)) dynamically while displaying in the grid. Scenario is that I have a custom class with some public properties. However, I dont want all of the public properties to be displayed in the UI. Is there a way out? I tried using TypeDescriptor. However, it works only at the type level an...

How to perform validation and feedback when using a PropertyGrid?

We're using the PropertyGrid to edit properties on a object and are looking for a means of providing validation. Specifically validation that indicates that the entire object is valid for being saved. Here's basic idea. Imagine two properties on a object Property: Widgets (a string collection) Property: DefaultWidget (a single s...

Array property display format in WinForms Property Grid

I have an object with a string[] property. When I assign this as the SelectedObject in the PropertyGrid, I get a "String[] Array" displayed for that property. Is there a way I can change this display part to something else? ...

A property grid in jQuery

I want to create a property grid like this: http://extjs.com/deploy/dev/examples/grid/property-grid.html However I don't want to use extjs, and am using jQuery instead. What plugin would most easily enable to me create a propertygrid? jqGrid is the only one that I know of right now. http://www.trirand.com/blog/ I am not interested in ...

PropertyGrid - Custom property names?

I feel like an idiot for being stumped by this, I feel like the answer must be obvious. But, alas, after spending too much time looking through the Object Browser and Googling, I come looking for help. I have a class that I use in a PropertyGrid. I found that by setting CategoryAttribute on each property it creates a new category for ea...

PropertyGrid - Dynamically changing ReadOnlyAttribute

Sigh, another PropertyGrid question. I thought I could get around this until I ran into a problem where I couldn't actually avoid it. I have a boolean property that sometimes needs to be read-only and sometimes needs to be changeable depending on the object selected from a TreeView. My question is how can I change the ReadOnlyAttribute...

Implement Object-Instance-Model to PropertyGrid

Hello, I am building a GUI application that will be the front-end for an XML configuration file. The XML structure defines a set of object instances. That is, type names, and property values that should be instantiated in the consuming application (windows service). So there are three layers: ConfigurationObject <--> ComponentObjects...

WPF DataBinding to Flag Enum (in a PropertyGrid)

I need to have the ability to select multiple values as is the nature of a Flag enumeration from a WPF view (all be it, in a PropertyGrid). The properties in question are dynamic and no pre-defined DataTemplates can be used as the type of the properties will be discovered at runtime. (A DataTemplate which can detect if an enumeration i...

Change Property Attribute Like ReadOnly at Design-Time (PropertyGrid)

Hi to all! I develop a custom control that have some field like below: ControlKind, Field1 , Field2 I want to change attribute of one of field per controlKind, Like: if controlKind == useField1, then Field1 show and Field2 hidde in properyGrid (or readonly or filter) can i do it ? Thanks in advance ...

How to determine when a PropertyGrid control is about to modify an object's property

I have a control extending PropertyGrid which allows users to set the properties of some of my program objects. These objects have an event which is raised when one of their properties changes, and the PropertyGrid subscribes to this event so that it refreshes itself when a property is changed. My problem occurs when large numbers of obj...

C# Using PropertyGrid control to change control properties "ThreadSafe"

I have a PropertyGrid that is setting control's properties of a control on another form. However for things such as "Location" and "Text", I get a cross threading issues. Is there an easy way to safely (not using AllowIlligalCrossThread=true) let the setting of these properties occur with the property grid? Thanks. ...

How can I catch scroll events in windows forms PropertyGrid

I'm trying to synchronize the vertical scrollbars of two property grids. The idea is when a user scrolls one property grid the other property grid scrolls by the same amount. My first approach was to handle the scroll event but it seems PropertyGrid doesn't generate this kind of event. I looked into the controls contained inside the Pro...