propertygrid

TypeConverter reuse in PropertyGrid .NET winforms

南楼画角 提交于 2019-12-12 06:53:58
问题 I would like to ask if it's possible to reuse the same TypeConverter when implementing a custom drop down list in a PropertyGrid, but with different items. Consider the following TypeConverter to implement a 2 item (dog/cat) drop down list in a PropertyGrid. Public Class MyList : Inherits System.ComponentModel.StringConverter Public items As String() = New String() {"dog", "cat"} Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel

WPF Extended Toolkit PropertyGrid: Change font color in rows and search box

北战南征 提交于 2019-12-12 04:23:47
问题 I am using the WPF Extended Toolkit PropertyGrid in a WPF app which also uses MahApps. I have set the application theme to BaseDark . When I display PropertyGrid, the text in the first column of the grid and in the Search textbox is white on a white background. I would like to change the Foreground color of this text to black. I have tried applying this Foreground color to various target controls (i.e. TextBlock , TextBox , DataGridCell ) in PropertyGrid.Resources.Style but this has not

Custom editors in a property grid that uses Dictionary

北战南征 提交于 2019-12-12 03:35:26
问题 I am using a property grid that uses a dictionary using the adapter found here. I now need the ability to use a custom editor. More specifically a file chooser. If the object in the dictionary is a string it just uses the default string editor. Could I implement a new class called FilePath or something that would just act as a wrapper for string but would cause the property grid to use the OpenFileDialog, and display the result as a string in the PropertyGrid once chosen? Is this possible?

dont show property when many object selected C# property grid

流过昼夜 提交于 2019-12-11 13:26:55
问题 I know how to prevent a property from being shown in the property grid by using this attribute [Browsable(false)] but I want to prevent this property from being browsed only when there are more than 1 object selected in the property grid. I mean that when only one object is selected in the property grid this property will be shown but when 2 or more objects are selected this property won't be browsable! 回答1: Note: I haven't done it myself, but according to the documentation... Have you tried

Editing a property of an object inside an object in PropertyGrid

被刻印的时光 ゝ 提交于 2019-12-11 12:17:31
问题 I'm trying to make an object, configureable/editable with a propertygrid. This is all going well, except for objects inside objects. I've got an object/class named "ContactInformation". And inside that object I've got an object named "Correspondence". This is how that part looks: [Browsable(false)] public Correspondence Correspondence { get; set; } public int CorrespondenceStatus { get { return this.Correspondence.Status; } set { this.Correspondence.Status = CorrespondenceStatus; } } public

WinForm propertygrid Collection Editor Add/Remove buttons Inactive

穿精又带淫゛_ 提交于 2019-12-11 11:47:30
问题 I am using the generic propertygrid to edit values from several custom classes. Some of these classes have collections and I can open those collections without a problem in the Collection Editor without a problem. If the collection already contains objects I am able to select those objects and edit them on the right, but the the Add/Remove buttons are inactive. I know for some of these collections are going to need a custom editor as they are quite complicated-- but most of them are quite

Analogous WinForms Propertygrid in WPF?

喜欢而已 提交于 2019-12-11 11:18:54
问题 DO we have Analogous WinForms Propertygrid in WPF? Thanks. 回答1: Not in the .NET Framework. You can use a WindowsFormsHost to use the Forms Property Grid, or you can look at one of the community implementations for WPF, like those (not sure which of them are still active): http://wpg.codeplex.com/ http://wpfpropertygrid.codeplex.com/ http://www.codeproject.com/Articles/87715/Native-WPF-4-PropertyGrid 回答2: Or the property grid which is part of the extended WPF toolkit. 来源: https://stackoverflow

PropertyGrid PaintValue issue: How to remove (and paint outside) the standard rectangle?

这一生的挚爱 提交于 2019-12-11 10:59:20
问题 This might be a straightforward question, even though I haven't found an easy solution to it: I've implemented my custom UITypeEditor with the sole purpose of adding a PaintValue to bools. For the sake of the discussion, let's assume that PaintValue will either paint a checked or unchecked radiobutton. Question 1: Now, here's the problem: It seems like PaintValue automatically inserts a 20x13px rectangle after all paint code has completed. Naturally, a radiobutton inside a black rectangle is

C# PropertyGrid - Check if a value is currently beeing edited

萝らか妹 提交于 2019-12-11 10:26:39
问题 Is there a simple way to find out if a property grid is currently being edited by the user? My usecase is the following: I update the grid data every second. If the user is editing a value, all inputs get lost when my update is called. So what I want to do is only update if the user is not editing something. 回答1: I don't think there is any official way. However the following piece of code can detect when a grid entry is opened using the builtin text box editor, or the dropdown editor. It does

Using a propertyGrid in C# Winforms to store information in a grid

给你一囗甜甜゛ 提交于 2019-12-11 10:16:21
问题 Could anyone help me out on something that is confusing. I'm trying to create a grid to store information for example document details: (name, type, summary as example headers). When the summary is too large for the cell of the grid I would like to have a button that would open a new control where the user is able to view more information. Is it possible to to this using a propertyGrid and would anyone be able to point me in the right direction on information on doing this? I was thinking it