Binding C1PropertyGrid to a Class

PropertyGrid for WPF allows you to easily bind the control to a class. At run time items in the class can be browsed and edited using the C1PropertyGrid control. For example, add a simple Customer class to your project defined as follows:

      Visual Basic

      C#

You could build a user interface to display and edit customers using the following code:

      Visual Basic

      C#

Run the application and observe that the resulting application would look similar to the following:

 

 

This simple UI allows users to edit all the properties in the Customer objects. It was built automatically based on the object's properties and will be automatically updated if you add or modify the properties in the Customer class.

Notice that properties are shown in alphabetical order by default. You can change this by setting the PropertySort property; for more information see Sorting Members in C1PropertyGrid.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.