Intersoft ClientUI Documentation
UXPropertyGrid Class
Members 



Represents a property grid control.
Object Model
UXPropertyGrid ClassIEditorSelector InterfaceISFramework ClassStyleSelector ClassUXPropertyGridResource Class
Syntax
<StyleTypedPropertyAttribute(Property="NumericEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXInput.UXCurrencyEditor)>
<StyleTypedPropertyAttribute(Property="EventEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCustomEditor)>
<StyleTypedPropertyAttribute(Property="ItemsEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)>
<TemplateVisualStateAttribute(Name="Events", GroupName="ViewStates")>
<TemplatePartAttribute(Name="SearchBox", Type=Intersoft.Client.UI.Aqua.UXCollection.UXSearchBox)>
<TemplatePartAttribute(Name="PropertyList", Type=Intersoft.Client.UI.Editors.UXPropertyList)>
<StyleTypedPropertyAttribute(Property="SearchBoxStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXSearchBox)>
<StyleTypedPropertyAttribute(Property="CollectionEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCollectionEditor)>
<StyleTypedPropertyAttribute(Property="BooleanEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)>
<TemplatePartAttribute(Name="PropertyMenu", Type=Intersoft.Client.UI.Aqua.UXContextMenu)>
<StyleTypedPropertyAttribute(Property="CustomEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCustomEditor)>
<StyleTypedPropertyAttribute(Property="EnumEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)>
<StyleTypedPropertyAttribute(Property="DefaultEditorStyle", StyleTargetType=Intersoft.Client.UI.Controls.UXTextBox)>
<StyleTypedPropertyAttribute(Property="DateTimeEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXInput.UXDateTimePicker)>
<TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)>
<DescriptionAttribute("Represents a property grid control.")>
<TemplateVisualStateAttribute(GroupName="ObjectsSelectionStates", Name="NoObjectsSelected")>
<TemplateVisualStateAttribute(GroupName="ViewStates", Name="Properties")>
<StyleTypedPropertyAttribute(Property="ToggleButtonStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXToggleButton)>
<TemplateVisualStateAttribute(GroupName="ObjectsSelectionStates", Name="HasObjectsSelected")>
Public Class UXPropertyGrid 
   Inherits Intersoft.Client.Framework.ISControl
   Implements Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, IEditorControl 
Dim instance As UXPropertyGrid
[StyleTypedPropertyAttribute(Property="NumericEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXInput.UXCurrencyEditor)]
[StyleTypedPropertyAttribute(Property="EventEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCustomEditor)]
[StyleTypedPropertyAttribute(Property="ItemsEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)]
[TemplateVisualStateAttribute(Name="Events", GroupName="ViewStates")]
[TemplatePartAttribute(Name="SearchBox", Type=Intersoft.Client.UI.Aqua.UXCollection.UXSearchBox)]
[TemplatePartAttribute(Name="PropertyList", Type=Intersoft.Client.UI.Editors.UXPropertyList)]
[StyleTypedPropertyAttribute(Property="SearchBoxStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXSearchBox)]
[StyleTypedPropertyAttribute(Property="CollectionEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCollectionEditor)]
[StyleTypedPropertyAttribute(Property="BooleanEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)]
[TemplatePartAttribute(Name="PropertyMenu", Type=Intersoft.Client.UI.Aqua.UXContextMenu)]
[StyleTypedPropertyAttribute(Property="CustomEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCustomEditor)]
[StyleTypedPropertyAttribute(Property="EnumEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)]
[StyleTypedPropertyAttribute(Property="DefaultEditorStyle", StyleTargetType=Intersoft.Client.UI.Controls.UXTextBox)]
[StyleTypedPropertyAttribute(Property="DateTimeEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXInput.UXDateTimePicker)]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[DescriptionAttribute("Represents a property grid control.")]
[TemplateVisualStateAttribute(GroupName="ObjectsSelectionStates", Name="NoObjectsSelected")]
[TemplateVisualStateAttribute(GroupName="ViewStates", Name="Properties")]
[StyleTypedPropertyAttribute(Property="ToggleButtonStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXToggleButton)]
[TemplateVisualStateAttribute(GroupName="ObjectsSelectionStates", Name="HasObjectsSelected")]
public class UXPropertyGrid : Intersoft.Client.Framework.ISControl, Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, IEditorControl  
[StyleTypedPropertyAttribute(Property="NumericEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXInput.UXCurrencyEditor)]
[StyleTypedPropertyAttribute(Property="EventEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCustomEditor)]
[StyleTypedPropertyAttribute(Property="ItemsEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)]
[TemplateVisualStateAttribute(Name="Events", GroupName="ViewStates")]
[TemplatePartAttribute(Name="SearchBox", Type=Intersoft.Client.UI.Aqua.UXCollection.UXSearchBox)]
[TemplatePartAttribute(Name="PropertyList", Type=Intersoft.Client.UI.Editors.UXPropertyList)]
[StyleTypedPropertyAttribute(Property="SearchBoxStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXSearchBox)]
[StyleTypedPropertyAttribute(Property="CollectionEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCollectionEditor)]
[StyleTypedPropertyAttribute(Property="BooleanEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)]
[TemplatePartAttribute(Name="PropertyMenu", Type=Intersoft.Client.UI.Aqua.UXContextMenu)]
[StyleTypedPropertyAttribute(Property="CustomEditorStyle", StyleTargetType=Intersoft.Client.UI.Editors.UXPropertyGridCustomEditor)]
[StyleTypedPropertyAttribute(Property="EnumEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXCollection.UXComboBox)]
[StyleTypedPropertyAttribute(Property="DefaultEditorStyle", StyleTargetType=Intersoft.Client.UI.Controls.UXTextBox)]
[StyleTypedPropertyAttribute(Property="DateTimeEditorStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXInput.UXDateTimePicker)]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[DescriptionAttribute("Represents a property grid control.")]
[TemplateVisualStateAttribute(GroupName="ObjectsSelectionStates", Name="NoObjectsSelected")]
[TemplateVisualStateAttribute(GroupName="ViewStates", Name="Properties")]
[StyleTypedPropertyAttribute(Property="ToggleButtonStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXToggleButton)]
[TemplateVisualStateAttribute(GroupName="ObjectsSelectionStates", Name="HasObjectsSelected")]
public ref class UXPropertyGrid : public Intersoft.Client.Framework.ISControl, Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, IEditorControl  
Remarks
UXPropertyGrid is an advanced editor control which provides an easy way to dynamically handle a vary types of objects instead of writing a custom view for each type. Designed to display a large number of properties, UXPropertyGrid implements VirtualizingStackPanel to solve the performance issue which may occur when dealing with large objects. UXPropertyGrid also comes with customizable editors which makes it possible to fit in various user specific scenarios. To improve its performance, UXPropertyGrid also will reuse the existing editors for different properties that use the same editor type to avoid object creation overhead.
Example

To ensure UXPropertyGrid works properly, you need to specify the target object to be displayed in the control. UXPropertyGrid has provided some approaches to define the target object.

Single Object

To display a single object in UXPropertyGrid, you use the SelectedObject property. Simply you only need to bind the object to UXPropertyGrid and it will do the rest.

XAML
Copy Code
<Intersoft:UXPropertyGrid SelectedObject="{Binding SelectedObject}"/>

Multiple Objects

UXPropertyGrid allows you to bind a collection of objects into SelectedObjects property. The objects can be in the same type or in a different type. Of course, UXPropertyGrid only will display the intersecting properties from each objects.

XAML
Copy Code
<Intersoft:UXPropertyGrid SelectedObjects="{Binding SelectedObjects}"/>

Using Properties Source

UXPropertyGrid also allows you to directly provide the property definition of properties you would like to show, so UXPropertyGrid doesn't need to generate the given object's properties. The following example shows how to use PropertiesSource in UXPropertyGrid.

XAML
Copy Code
<Intersoft:UXPropertyGrid PropertiesSource="{Binding PropertiesSource}"/>
C#
Copy Code
public class PropertiesSourceViewModel : ViewModelBase
{
    private IEnumerable _propertiesSource;
    
    public IEnumerable PropertiesSource
    {
        get { return _propertiesSource; }
        set
        {
            if (_propertiesSource != value)
            {
                _propertiesSource = value;
                OnPropertyChanged("PropertiesSource");
            }
        }
    }

    public PropertiesSourceViewModel()
    {
        this.InitializePropertiesSource();
    }

    private void InitializePropertiesSource()
    {
        ObservableCollection<PropertyGridDefinition> propertiesSource = new ObservableCollection<PropertyGridDefinition>();

        propertiesSource.Add(new PropertyGridDefinition() { Category = "Book Information", Name = "Title", Type = typeof(string), Display = "Title", SortOrder = 5, Value = "Silverlight/WPF Pro", Description = "Book's title" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Book Information", Name = "Edition", Type = typeof(byte), Display = "Edition", SortOrder = 4, Value = 5, Description = "Book's edition", DefaultValue = 5 });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Book Information", Name = "Genre", Type = typeof(string), Display = "Genre", SortOrder = 3, Value = "Software Development", Description = "Book's genre" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Book Information", Name = "Language", Type = typeof(string), Display = "Language", SortOrder = 2, Value = "English", Description = "Book's language" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Book Information", Name = "Author", Type = typeof(string), Display = "Author", SortOrder = 1, Value = "John Doe", Description = "Book's author" });

        propertiesSource.Add(new PropertyGridDefinition() { Category = "Details", Name = "PublishDate", Type = typeof(DateTime), Display = "Publish Date", SortOrder = 5, Value = DateTime.Now, Description = "Book's publish date" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Details", Name = "Publisher", Type = typeof(string), Display = "Publisher", SortOrder = 4, Value = "ABC Publishing", Description = "Book's publisher" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Details", Name = "ISBN", Type = typeof(string), Display = "ISBN", SortOrder = 3, Value = "2343-1667-8763", Description = "Book's ISBN" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Details", Name = "Pages", Type = typeof(short), Display = "Pages", SortOrder = 2, Value = 265, Description = "Total pages of the book" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Details", Name = "Price", Type = typeof(double), Display = "Price", SortOrder = 1, Value = 108.34, StringFormat = "C2", Description = "Book's price" });

        propertiesSource.Add(new PropertyGridDefinition() { Category = "Dimensions", Name = "Width", Type = typeof(short), Display = "Width", SortOrder = 3, Value = 520, Description = "Book's width" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Dimensions", Name = "Height", Type = typeof(short), Display = "Height", SortOrder = 2, Value = 860, Description = "Book's height" });
        propertiesSource.Add(new PropertyGridDefinition() { Category = "Dimensions", Name = "Depth", Type = typeof(short), Display = "Depth", SortOrder = 1, Value = 52, Description = "Book's depth" });

        this.PropertiesSource = propertiesSource;
    }
}
Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      System.Windows.UIElement
         System.Windows.FrameworkElement
            System.Windows.Controls.Control
               Intersoft.Client.Framework.ISControl
                  Intersoft.Client.UI.Editors.UXPropertyGrid

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

UXPropertyGrid Members
Intersoft.Client.UI.Editors Namespace

Send Feedback