propertygrid

StringConverter GetStandardValueCollection

早过忘川 提交于 2019-12-13 16:42:37
问题 I am trying to use property grid for displaying data. I have to write StringConverters for my predefined string constants so that they can be shown on a combo box. Consider a list of colors and another list of angles 0,90,180,270. There are many such lists I want to display on the grid. I am writing new classes deriving from StringConverters and overriding GetStandardValues class AngleConverter : StringConverter { string[] Units = { "0", "90", "180","270" }; public override bool

How do you customize the descriptions in the Collection Editor of the PropertyGrid object?

最后都变了- 提交于 2019-12-13 15:05:34
问题 I have a class that contains several public properties. One of those properties is a List containing instances of another class. It breaks down something like this: namespace Irig106Library.Filters.PCM { [Description("Definition")] public class MinorFrameFormatDefinition { [Description("Word Number")] public int WordNumber { get; set; } [Description("Number of Bits")] public int NumberOfBits { get; set; } } public class MinorFrame { // ... other properties here [Category("Format")]

Programmatically hiding properties in a PropertyGrid

ぃ、小莉子 提交于 2019-12-13 14:19:49
问题 I'm looking to hide/show properties depending on what selection the user makes in a drop. I am handling the event fine, but cannot actually make the correct properties disappear. The solutions I have found on line are mainly from 2005 and as I've had very little experience with it I thought I must be doing something wrong if hiding properties is this hard. So far I have tried accessing the property once the event is handled but the ReadOnly and IsBrowsable properties are read only. The

WinForms PropertyGrid behaving unexpectedly in WPF app

♀尐吖头ヾ 提交于 2019-12-13 05:17:17
问题 I'm using the WinForms PropertyGrid to edit object properties in a WPF app. However, the PropertyGrid isn't working as expected with certain property types. Specifically, objects exposing properties of type Color or Brush are displayed as text, #FF000000 , for example, and the drop-down color selector list doesn't appear when a cell of that type is clicked in the PropertyGrid . It is my understanding that built-in editors exists for these types and I shouldn't have to do anything extra to get

Optimize class for PropertyGrid

折月煮酒 提交于 2019-12-13 01:55:25
问题 I have a class Foo defined in a library which is used in the GUI project. The GUI project allows graphical editing of an instance of Foo with the help of a System.Windows.Forms.PropertyGrid . To make editing of an instance of class Foo in a PropertyGrid comfortable, I have to set several attributes to Foo's properties, Browsable for example. However, I do not want to set up these attributes in Foo because the library it's in should have only the required things needed to use Foo in code (not

WPF Xceed PropertyGrid showing “Xceed.Wpf.Toolkit.PropertyGrid.Attributes.Item” instead of the real DisplayName

戏子无情 提交于 2019-12-13 00:39:16
问题 I'm trying to use Xceed PropertyGrid to show dropdown with hardcoded string values. Instead of showing the items as the strings I assign as the IItemSource , PropertyGrid showing: "Xceed.Wpf.Toolkit.PropertyGrid.Attributes.Item" for each item in the dropdown. When I select an object, the desired string is showing as the chosen item. This is the dropdown items I see: And when I choose an item, I can see it the way I want it to appear as the dropdown items as well: My code: XAML: <xctk

Property Grid on Composite objects

我是研究僧i 提交于 2019-12-12 19:09:18
问题 When I bind this object public class MyObject { public AgeWrapper Age { get; set; } } public class AgeWrapper { public int Age { get; set; } } to a property grid, what is shown in the value section of the property grid is the class name of AgeWrapper, but the value for AgeWrapper.Age. Is there anyway to make it so that in the property grid I can show the value of the composite object ( in this case, it's AgeWrapper.Age), instead of the class name of that composite object? 回答1: You need to

How to connect a custom propertyGrid with a standard control in C#?

谁都会走 提交于 2019-12-12 14:23:43
问题 I am creating a graphing program and I would like to allow the user to be able to change the look of the graph they create. Providing them with the opportunity to change the series color, data point size, ect. I am allowing them to do this through the use of a propertyGrid. Through the help of the wonderful people who use stack overflow I was able to import all the properties of a chart into my property grid, however; Now I can't figure out how to connect my chart to the propertyGrid, so when

Property set isn't being triggered with a UITypeEditor implemented

寵の児 提交于 2019-12-12 10:42:48
问题 I have a property grid that when a button is clicked for one of the properties, certain fields are filled in. However the property's set isn't being triggered. I do not know why. private OptoSigmaSettings dataToGet = new OptoSigmaSettings(); [Editor(typeof(OptoSetupFormEditor), typeof(UITypeEditor))] [TypeConverter(typeof(ExpandableObjectConverter))] [Category("Setup")] public OptoSigmaSettings DataToGet { get { return dataToGet; } set { MessageBox.Show("Im here"); //This isnt happening.

Custom ColorEditor does not work properly on Color struct

二次信任 提交于 2019-12-12 10:04:54
问题 I asked here how to use custom color dialog in property grid for Color struct: Using custom color picker dialog in PropertyGrid From that link you can see code of MyColorEditor class if needed. Now i can use custom color dialog but only if i use my own struct which is RGBA in that example. If i use this custom type editor on color struct it looks like this in property grid: But if i use RGBA struct which i created, it looks properly: Problem happens because UITypeEditorEditStyle.Modal not