Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to: Show object properties

$
0
0

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.

[C#]
publicpartialclassMainWindow{publicMainWindow(){DataContext=newContact("Carolyn","Baker");InitializeComponent();}}publicclassContact{publicstringFirstName{get;set;}publicstringLastName{get;set;}publicContact(stringfirstName,stringlastName){FirstName=firstName;LastName=lastName;}}
[XAML]
<dxprg:PropertyGridControlSelectedObject="{Binding Path=.}"/>

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

[C#]
publicpartialclassMainWindow{publicMainWindow(){DataContext=newList<Contact>{newContact("Carolyn","Baker"),newContact("Amber","Seaman")};InitializeComponent();}}
[XAML]
<dxprg:PropertyGridControlSelectedObjects="{Binding Path=.}"ExpandCategoriesWhenSelectedObjectChanged="True"/>


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>