Several questions regarding property grid

Grids for WPF Forum

Posted 11 years ago by Anurodh Ora
Version: 4.5.0482
Avatar
Hi,

I have Several questions regarding property grid. i have also sent a sample project to support center.

1. How to make property editable all time as the user start typing. Also if user press ESC then changes should be revert(i.e. as user selects a property and start typing then value should be editable in that case).

2. How to make property editable by "F2", Space keys(i.e. as user select the property & press F2 or space then cursor should be focus to editor) and also should be saved as user presses ENTER or revert if user presses ESC key.

4. Custom editors should be available/display/highlighted when user selects particular property otherwise it should display like a text box as in Visual studio.

5. When property grid bind to a data source(as in sample code) then how to apply custom editors for a specific property like combo box, DateTime etc.

6. Is there any way to apply theme from XAML.

7. Is there any way to have Column Headers(Name, Value) of property as in the Data Grid.

8. The ModifiedPropertyDisplayMode="BoldValue" property sets all values as the application start to Bold, however the required behavior should be, if user changes the property value then only particular property value set to Bold. Is this a know issue?

9. Can we have a TextBox in dropdown for a lengthy string editing like in visual studio property page(i.e. If a property is of string type and user wants edit it then instead of providing a separate text editor dialog, we can have text box in drop down in same position).

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Anurodh,

Your best option for #1, #2, #4, and #9 would be to use a custom (or user) control for the value editor. The custom control could display the property value using a TextBlock until a given key is pressed. When the custom control detects the given key (F2, or any other key), then it would switch out the TextBlock for a TextBox, ComboBox or whatever. To support ESC, you would simply need to cache the previous value when you start editing (or the control gets focus), then restore if ESC is pressed (same goes for Enter).

#5. Property editors can be associated to a property either by property name or property type via the PropertyGrid.PropertyEditors collection. In addition, the PropertyGridPropertyItem object have ValueTemplate(Selector) properties that can be used to override a particular property. There are several ways of populating the PropertyGrid, so you would need to be more specific about what you mean by "bind to a data source". If you can send over a sample project, then that would probably be best.

#6. Yes you can change the them by setting the attached Theme property something like:
<Window
    ...
    xmlns:propgrid="http://schemas.actiprosoftware.com/winfx/xaml/propgrid"
    xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes">

    ...
    
    <propgrid:PropertyGrid themes:ThemeManager.Theme="AeroNormalColor" />
            
</Window>
#7. This is not currently support, but is on our TODO list.

#8. The ModifiedPropertyDisplayModee only shows bold if the current Value differs from the DefaultValue, not if the user has explictly modified the value. This duplicates how the WinForms PropertyGrid works. You typically need to specify the default value, using either PropertyGridPropertyItem.DefaultValue, DefaultValueAttribute, or through a ShouldSerializeXXX (where XXX is the property name) method. If you are seeing something different, please send over a sample project that reproduces the issue.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.