propertygrid

C# Winform CollectionPropertiesEditor - How to hide some properties in the built-in PropertyGrid based on runtime condition

醉酒当歌 提交于 2019-12-11 01:37:56
问题 Is there a way to hide show properties in “CollectionPropertiesEditor’s PropertyGrid” Recently I found out that there is a way to change the PropertyGrid’s Browsable attribute at run time. I want to know if this can be done to a “CollectionPropertiesEditor’s PropertyGrid”, I have been un-successful at finding relevant results on Google Search. Now I have my hopes on StackOverflow to help me solve this problem. Problem: I had to add some properties to GridColumn control due to new customer

Using Custom PropertyTab in System.Windows.Forms.PropertyGrid Control

六月ゝ 毕业季﹏ 提交于 2019-12-10 23:49:56
问题 I am trying to use the customisable property tab feature of the WinForms PropertyGrid control but it has me beaten. I am specifically trying to use in runtime a PropertyGrid to display object properties, as opposed to trying to create design-time support for a control, though they seem to be applications of similar technology. This question has me seriously confused. I have attempted to follow several tutorials on the topic and none come to any real solid conclusion. Literature Review http:/

Setting ReadOnly Property in PropertyGrid Sets All Properties Readonly

和自甴很熟 提交于 2019-12-10 23:06:45
问题 I am using a PropertyGrid control to edit my class properties and I am trying to set certain properties read-only depending on other property settings. This is the code of my class: Imports System.ComponentModel Imports System.Reflection Public Class PropertyClass Private _someProperty As Boolean = False <DefaultValue(False)> Public Property SomeProperty As Boolean Get Return _someProperty End Get Set(value As Boolean) _someProperty = value If value Then SetReadOnlyProperty("SerialPortNum",

InvalidCastException casting object to its own type

霸气de小男生 提交于 2019-12-10 21:18:23
问题 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 am using custom TypeDescriptors with GetStandardValues() overrides to get the property grid to show a drop down for those properties. This was all working just

How can I expand a ExpandableObjectConverter object in a PropertyGrid automatically?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 17:03:58
问题 I have a .net PropertyGrid. I select an object to view, and a property of that object is a Vector3. I can use ExpandableObjectConverter to automatically expose the properties of the Vector3 into in the PropertyGrid. All fine, except that when the object is selected I'd like the Vector3 to be expanded by default, i.e. so you can see X, Y & Z without having to click [+]. How can I do this? // Managed C++ : [TypeConverter(ExpandableObjectConverter::typeid)] public ref struct Vector3 { Vector3

How to show or hide properties dynamically in the PropertyGrid?

南楼画角 提交于 2019-12-10 14:36:11
问题 I am using a PropertyGrid for configuring objects. I need to be able to hide or show some properties depending on the values of other properties. How this can be achieved? I know about Browsable attribute, but it only works at a compile time. 回答1: Take a look into the ICustomTypeDescriptor Interface. Further informations on how to use it can be found in this article: Bending the .NET PropertyGrid to Your Will. 回答2: Check this link Changing Browsable Property Attribute dynamically.A sample

WPF PropertyGrid supports multiple selection

筅森魡賤 提交于 2019-12-10 13:54:56
问题 Is this documentation still valid or am I missing something? http://doc.xceedsoft.com/products/XceedWpfToolkit/Xceed.Wpf.Toolkit~Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid~SelectedObjects.html PropertyGrid control does not appear to have SelectedObjects or SelectedObjectsOverride members. I'm using the latest version (2.5) of the Toolkit against .NET Framework 4.0. UPDATE @faztp12's answer got me through. For anyone else looking for a solution, follow these steps: Bind your PropertyGrid 's

How to show Drop down control in Property Grid?

若如初见. 提交于 2019-12-10 12:38:18
问题 I am adding the Property grid control in my project. I have to show the Drop down box in one field of Property Grid. Is there any solution to apply this. 回答1: You have to declare a type editor for the property in your PropertyGrid and then add to the list of choices. This example creates a Type Converter and then overrides the GetStandardValues() method to provide choices to the drop-down: private String _formatString = null; [Category("Display")] [DisplayName("Format String")] [Description(

PropertyGrid validation

妖精的绣舞 提交于 2019-12-10 11:03:10
问题 I have a PropertyGrid . When I enter a bad-format value (i.e. - a string into an integer item), I get an error message. If I click "OK", the bad value stays until I change it. If I click "Cancel", the original value is back. I want to control the buttons so clicking "OK" will also set the original value back instead of showing the bad value like the cancel button. How can I do that? 回答1: I'll join @Crono on that, why do you want that what you want? If you would ask how can I remove that

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 02:43:32
问题 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. 回答1: Yes, add this attribute to the property. [EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))] 来源: https://stackoverflow.com/questions/3656345/propertygrid-possible-to-have-a-file-directory