Files to look at:
- Data.cs (VB: Data.vb)
- MainWindow.xaml (VB: MainWindow.xaml)
- MainWindow.xaml.cs (VB: MainWindow.xaml.vb)
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"/>
(you will be redirected to DevExpress.com to submit your response)