propertygrid

Creating / Modifying Enums at Runtime

送分小仙女□ 提交于 2019-12-04 03:27:41
I'm creating a program where the user has the option of creating their own custom properties that will ultimately be displayed in a PropertyGrid . Right now I don't want to mess with custom editors, so I'm only allowing primitive type properties ( string , int , double , DateTime , bool etc.) that the PropertyGrid already has built in editors for. However, I also want to give the user the option to create multiple choice properties where they can defined a list of possible values which in turn will show up as a drop down list in the PropertyGrid . When I hard code an Enum in my code the

Binding generic collection List<> to property grid

微笑、不失礼 提交于 2019-12-03 21:53:17
问题 I try binding generic collection listContact to propGrid but output does not match what I expected. I want listContact to be shown like ListBox in propGrid . How do I do it? Thank you. class Contact { public string Name { get; set; } public string Address { get; set; } } PropertyGrid propGrid = new PropertyGrid(); List<Contact> listContact = new List<Contact>(); private void Form1_Load(object sender, EventArgs e) { listContact.Clear(); Contact newContact = null; newContact = new Contact();

Using custom color picker dialog in PropertyGrid

人盡茶涼 提交于 2019-12-03 21:00:43
In PropertyGrid default color picker dialog not allow to set alpha value of color. I already made my own color picker dialog and want to use it in PropertyGrid but not sure how to do it. Jaex I managed to use my custom color picker dialog in property grid and copying code of it here in case some need it too: using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.Design; namespace HelpersLib { public class MyColorEditor : UITypeEditor { public override UITypeEditorEditStyle GetEditStyle

C# Propertygrid combobox with enum values (Win Forms)

99封情书 提交于 2019-12-03 20:32:10
public enum eVisualType { None = 0, Torch = 1, Rune01, Rune02, Rune03, FireRed01, LaserBlackWhiteLeft, LaserBlackWhiteRight, LaserBlueRedLeft, LaserBlueRedRight, Wheel01, Wheel01a, Wheel02, BlinkingStar, MovingPillar } public class EnumTypeConverter : TypeConverter { public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; // True means show a combobox } public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) { return true; // True will limit to list. false will show the list, but allow free-formentry } } public class

How do I change boolean properties with one click in PropertyGrid

空扰寡人 提交于 2019-12-03 16:01:49
We have a windows form PropertyGrid that we use to display all the properties. We have drawn a checkbox on Boolean property that checks it self and unchecks itself based on the value. this all works fine. the issue is, that user wants to change the check box value in single click, whereas property grid changes it on a double click and I cant figure out a way to handle clicks or change property value on single click when property type is Boolean. Any idea about how to change property value in single click will be helpful. Thanks PropertyGrid internally has methods which allows us to use them

How can I customize category sorting on a PropertyGrid?

这一生的挚爱 提交于 2019-12-03 15:08:21
问题 How can I customize the sorting of categories in a PropertyGrid ? If I set either of the following... propertyGrid.PropertySort = PropertySort.Categorized; propertyGrid.PropertySort = PropertySort.CategorizedAlphabetical; ... then the categories will be alphabetized. ("Alphabetical" would seem to apply to the properties within each category.) If I use PropertySort.NoSort , I lose categorization. I'm populating my PropertyGrid with SelectObject , which is pretty easy: this.propertyGrid1

How can I get an OpenFileDialog in a custom control's property grid?

旧巷老猫 提交于 2019-12-03 06:39:41
I'm creating a .net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set : [Browsable(true), Category("Configuration"), Description("List of Files to Load")] public string ListFiles { get { return m_oList; } set { m_oList = value; } } Depending upon the type of object, (string, string[], List, ...), the property grid will allow the user to enter some data.. My goal would be to have a filtered openfiledialog in the Properties Grid of my component that would enable the user to choose multiple files and return it as

List of PropertyGrid Attributes

十年热恋 提交于 2019-12-03 05:20:34
I can't find any list of the available attributes for the PropertyGrid in C#, do you know where I can find one? Thanks. The attributes that impact PropertyGrid are indirect: the interesting code is the TypeDescriptor which provides the PropertyDescriptor implementation. However, this van be overruled by ICustomTypeDescriptor or TypeDescriptionProvider. However, if we assume the default rules, the key attributes in play are: [DisplayName(...)] [Description(...)] [Category(...)] [TypeConverter(...)] [ReadOnly(...)] [Browsable(...)] [DefaultValue(...)] [Editor(...)] Some other things are detected

How can I customize category sorting on a PropertyGrid?

。_饼干妹妹 提交于 2019-12-03 04:49:58
How can I customize the sorting of categories in a PropertyGrid ? If I set either of the following... propertyGrid.PropertySort = PropertySort.Categorized; propertyGrid.PropertySort = PropertySort.CategorizedAlphabetical; ... then the categories will be alphabetized. ("Alphabetical" would seem to apply to the properties within each category.) If I use PropertySort.NoSort , I lose categorization. I'm populating my PropertyGrid with SelectObject , which is pretty easy: this.propertyGrid1.SelectedObject = options; options is an instance of a class with suitably decorated properties:

Property Grid in ExtJs

若如初见. 提交于 2019-12-02 20:42:07
问题 I have some store, which is formed data. On panel it looks how "fieldName" and text field (in depension from invoked form). For example, on one form is displayed "name document" and field, on another: date of selling and date field. Data is formed dynamicly Here is store: tableTempStore = new Ext.data.JsonStore({ url: objectUrlAddress, baseParams: { 'objectID': objectID }, root: 'Fields', fields: [{ name: 'Type', type: 'int' }, { name: 'Value' }, { name: 'IsRequired', type: 'bool' }, { name: