ASPx Group

ASPx Group Property Editor allows to divide Detail View on groups of properties. At the time when the user edits one of the groups, the remaining groups are displayed in the View mode, which significantly accelerates Web application.

To fully demonstrate the features, it is required to consider business class with a significant number of properties of various types.

The code snippet below implements GroupPropertyEditorObject Domain Component.

The code above reffers to the GroupPropertyEditorListObject type implemented in the following snippet:

 

Note

ThisObject property returns an object of the GroupPropertyEditorObject type, i.e. this property represents the entire object.

You can view the code used in this lesson in the Xafari.FeatureCenter| Editors|GroupPropertyEditorObject.cs file of the Feature Center demo installed with Xafari. By default, the Feature Center application is installed in %PUBLIC%\Documents\Xafari Framework vXX.X.XXXX Demos\Feature Center.

We will apply ASPx Group Property Editor to ThisObject property. To get the functionality of the ASPx Group Property Editor, you need to add Xafari.Editors and Xafari.Editors.Web Modules to the required project.

Divide business class properties into the following groups: StringProperty, IntProperty, DateTimeProperty, ObjectProperty, ListProperty. It is necessary to create and configure the appropriate Detail View for each of these groups.

Invoke Model Editor, right-click the Views node and select Add|Detail View from the context menu. Focus the new Detail View and set ModelClass property to the GroupPropertyEditorObject value, set Id property to the GroupPropertyEditorObject_DetailView_Int value. Edit the Items subnode so that it includes only Int properties.

Similarly, add the Detail Views to the other groups. Image below demonstrates required Detail Views.

property_editor_aspx_group_1

Next, you should configure the default Detail View by adding Property Editors, which will display conceived group.

Navigate to the Views|...|GroupPropertyEditorObject_DetailView|Items node and remove all nested elements except Name. Add new Property Editor to the Items node and set its properties as follows:

  • PropertyName = ThisObject
  • PropertyEditorType = Xafari.Editors.Web.ASPxGroupPropertyEditor
  • View = GroupPropertyEditorObject_DetailView_Int
  • Id = IntProperty

Similarly, add the Property Editors to the StringProperty, DateTimeProperty, ObjectProperty and ListProperty groups. Image below demonstrates configuration for the default Detail View.

property_editor_aspx_group_2

Run the ASP.NET application, select the appropriate item in the navigation control and invoke GroupPropertyEditorObject_DetailView. To see the property, expand corresponding group, to edit the property, click "Edit" near the group.

property_editor_aspx_group_3