propertygrid

Property grid only show some category

强颜欢笑 提交于 2019-12-09 19:48:28
问题 I got a PropertyGrid that is use on an object that have the following property category : Style, Calcul and Misc What I want is to only show to the user the Calcul category, but I don't want to use the browsable attribute because I want all these property to be visible in Visual studio. So, what I need, is an in-code solution. I use .Net 3.5 c# 回答1: PropertyGrid has a property - BrowsableAttributes ; assign this your categories: propGrid.BrowsableAttributes = new AttributeCollection( new

List of PropertyGrid Attributes

廉价感情. 提交于 2019-12-09 05:14:38
问题 I can't find any list of the available attributes for the PropertyGrid in C#, do you know where I can find one? Thanks. 回答1: 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(...)]

C# Propertygrid default value typeconverter

给你一囗甜甜゛ 提交于 2019-12-08 12:59:55
问题 I have a propertygrid with a dropdown box. In my application a user can click on a block and then the properties of that block are shown in a propertygrid. But the first time they click on a block an invalid value (0) is shown in the dropdown. How can I make sure that a valid value is shown? Here is some code of the TypeConverter: public class DynamicFormScreenId : Int32Converter { public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } public override

Constructor not found for String

拜拜、爱过 提交于 2019-12-08 12:45:35
If I have an object in a property grid containing a List<string[]> or Dictionary<string,string[]> (using GenericDictionaryEditor ), when I click on the detail beside the property and click add, a message pops up saying that no constructor can be found (for the list) or no parameterless constructor found (for the dictionary). I don't understand editors or the property grid really, and any help would be appreciated. [DataMember(Name="FolderPaths")] [ReadOnly(false)] [Description("List of folder paths")] [Editor(typeof(Wexman.Design.GenericDictionaryEditor<string, string[]>), typeof(UITypeEditor)

Properties “inlineEdit:true” in jqgrid?

一个人想着一个人 提交于 2019-12-08 11:58:10
问题 There properties "inlineEdit:true" in jqgrid? for example code is : rowNum:10, rowList:[10,40,70], pager: '#rowsTransaksi', sortname: 'depositType', viewrecords: true, sortorder: "desc", caption:"Payee Accounts", forceFit : true, cellEdit: true, ***inlineEdit:true*** inlineEdit:true, editurl:"noabjad.json", 回答1: You can use for example the following onSelectRow event handler: onSelectRow: function (rowid) { if (rowid !== lastSel) { myGrid.jqGrid('saveRow', lastSel); lastSel = rowid; } myGrid

Change the foreground color of read-only properties in a propertygrid

核能气质少年 提交于 2019-12-08 08:15:25
问题 I'm using a WinForms property grid to display the properties of an object. However, most of the properties are read only and thus show up as grey rather then black. Is there a way to customize the colors that are used? I'd like the disabled properties to be a bit easier to read. BTW: I think the answer to this question might be related to what I'm trying to do. But I'm not sure exactly how I can access ControlPaint.DrawStringDisabled . 回答1: Unfortunately, there's no built-in way to change the

C# Selecting first row in CategorizedAlphabetical sorted ProperyGrid

帅比萌擦擦* 提交于 2019-12-08 07:14:32
问题 I have ProperyGrid loaded with categorised PropertySpec and set to CategorizedAlphabetical sort. When form runs categories then items within categories are sorted. An annoying artefact is that PropertyGrid by default selects the first item after list was sorted and sometimes it scrolls view to selection. If item list is long you end up seeing list scrolled to somewhere in the middle. Since PropertySpec can be created at runtime I want to always show the top of list on form load. PropertyGrid

XCeed PropertyGrid customizing IntegerUpDown

给你一囗甜甜゛ 提交于 2019-12-08 06:24:07
问题 I'm trying to assign different increment values to different fields of an object. For example, consider a class has who has int1 and int2 , and when I set ShowAdvancedOptions to true for my PropertyGrid , integer up down buttons are put in the textbox with no problems. But I want to be able to edit how much the numbers are incremented individually. Is there a way I can ahcieve this? Edit: Here is the code: public MainWindow() { InitializeComponent(); Sample or = new Sample(); pg

Property Grid create new instance on a property

末鹿安然 提交于 2019-12-08 06:15:20
问题 I'm trying to build a quick administrative interface using the built in Windows.Forms PropertyGrid . I managed to decorate my data classes with the appropriate attributes (ExpandableObjectConverter etc.) and all seems to work fine. There is a use case I'm not figuring out: When i have values set on complex properties the expand button appears and i can edit the content but when i have a null value there seems to be no way to create a new instance of the desired type. So a solution to this

C# PropertyGrid: Changing properties not working?

无人久伴 提交于 2019-12-08 04:26:33
问题 I have a property on my World class that looks like this: public Vec2 Gravity { get { Console.WriteLine("Getting gravity!"); return GetGravity(); } set { Console.WriteLine("Setting gravity!"); SetGravity(value); } } The "Getting gravity!" string is displayed as expected, when the PropertyGrid tries to read the value, but when I try to change the gravity vector and press enter, nothing happens. Why not? My Vec2 class has properties: public float X { get { return x; } set { x = value; } }