propertygrid

C#/winforms: how to best bind a propertygrid and a System.Data.DataRow

隐身守侯 提交于 2020-01-09 19:11:31
问题 i have System.Data.DataRows with several fields, most of them just plain types like int, single, string. what is the best way to make them editable using a propertygrid? it should work automatically no matter what kind of fields the datarow has, but it should not display all of them. i want to provide a list of properties that should be hidden. since the DataTable is autogenerated i cannot add custom attributes like [Browsable(false)] thanks a lot! 回答1: Edited to handle filtering; much

Can't show class with interface properties in PropertyGrid

别来无恙 提交于 2020-01-05 07:05:14
问题 Currently i'm trying to configure some of my classes through the PropertyGrid. Now i have some problems about showing the value (the right side within the grid) if the class provides the property as an interface. I thought, cause the grid uses reflection it would take the real type and uses it's normal ways on showing the value within the grid. For a demonstration simply take the class hierarchy below and create a simple form with a PropertyGrid and put the object into it by calling

PropertyGrid mult. controls select, null exception on property set?

﹥>﹥吖頭↗ 提交于 2020-01-05 03:33:11
问题 I have a custom object, ComplexName, that I want to show in the propertygrid (in the VS designer, not at runtime). It all seems to work correctly (with the ExpandableObjectConverter implemented), when I have just one control selected. I can set any\all of the attributes the way I want them to (expanded or via the typeconverter). When I select multiple controls though, the issue starts. At first, When you selected multiple objects with the same property (with the same value), I wanted the text

How to add a service to the type descriptor context of a property grid in .Net?

吃可爱长大的小学妹 提交于 2020-01-05 03:07:08
问题 I have an app that allows the user to choose an image, at design time, either as a straight image, or from an image list. All cool so far, except that this is not happening from the visual studio property browser, its happening from a property grid that is a part of a type editor. My problem is, both the image picker (actually resource picker), and the imagelist type converter rely on some design-time services to get the job done. In the case of imagelist, its the IReferenceService and in the

Change column name - Vaadin 7.8.4

萝らか妹 提交于 2020-01-04 09:19:09
问题 I use IndexedContainer in my grid. Grid grid = new Grid(); IndexedContainer container = new IndexedContainer(); grid.setContainerDataSource(container); container.addContainerProperty("Something", String.class, ""); I need to change the name of the container property. E.g property "Something" to "New property" after the click on the button. Any ideas ? Thank you very much ! 回答1: NOTE 1: Where did you get vaadin 7.8.4 from? The latest 7.x release I can see is 7.7.10. For this exercise I'll

How do I format/Alter displayed value in property grid

纵饮孤独 提交于 2020-01-04 09:13:00
问题 Am trying to work with a Winform Property Grid , and I am not able to format displayed value (mind too strongly tied to wpf now) So what I want is, there is a drop down in property grid that has its own UITypeEditor , this editor shows values such as 1 - On 2 - Off 3 - Unknown so the property on that listens to propertyGrid changes is int and for some odd reasons I cant change it to string, so like in wpf can I have a converter sort of thing that converts 1 into 1- On and 1-On to 1 ? how can

C# PropertyGrid drag drop

拜拜、爱过 提交于 2020-01-03 19:17:14
问题 I'm trying to implement drag/drop support to a propertygrid in C# using VS2005 (.NET 2.0). The propertygrid can handle the dragenter etc. events, but there doesn't seem to be a way to get the griditem under the pointer during a drag event. The best I've been able to get so far is to use the selectedgriditem property to retrieve a custom propertydescriptor and set the value, but this requires a grid item to already be selected before starting the drag/drop operation. Has anyone had any luck

How can I catch scroll events in windows forms PropertyGrid

眉间皱痕 提交于 2020-01-03 03:44:12
问题 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 PropertyGrid and there is a PropertyGridView, that I bet is the control with the scrollbar. Does anybody know a workaround to achieve what I want? Thank you. 回答1:

Constructor not found for String

混江龙づ霸主 提交于 2020-01-03 03:30:44
问题 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

Constructor not found for String

雨燕双飞 提交于 2020-01-03 03:30:09
问题 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