Skip to content

DevExpress-Examples/wpf-property-grid-display-object-properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

WPF Property Grid - Display object properties

The PropertyGridControl is the control designed to edit object properties. It can be bound to a specific object as well as a collection of objects.


To browse and manage properties of a specific object, set the  PropertyGridControl.SelectedObject property to this object.

public partial class MainWindow {
    public MainWindow() {
        DataContext = new Contact("Carolyn", "Baker");
        InitializeComponent();
    }
}
public class Contact {
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public Contact(string firstName, string lastName) {
        FirstName = firstName;
        LastName = lastName;
    }
}
<dxprg:PropertyGridControl SelectedObject="{Binding Path=.}"/>


To edit properties of multiple objects simultaneously, use PropertyGridControl.SelectedObjects.

public partial class MainWindow {
    public MainWindow() {
        DataContext = new List<Contact> { new Contact("Carolyn", "Baker"), new Contact("Amber", "Seaman") };
        InitializeComponent();
    }
}
<dxprg:PropertyGridControl SelectedObjects="{Binding Path=.}" ExpandCategoriesWhenSelectedObjectChanged="True"/>


Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Uses the WPF Property Grid Control to display object properties.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •