ViewIdPropertyEditor. Getting Started

In this lesson we will create a simple class, which will expose View.Id string property. And then ViewIdPropertyEditor will be assigned for this property. Follow the steps described below.

  • Add a ObjectWithStringViewId business-class in your XAF-application. Use following code:
  • Create a number of objects using the next updater:
  • Add modules XafariModule and XafariEditorsModule to Module Project.
  • Add modules Xafari.WinModule and Xafari.Editors.WinModule to the Windows Forms Application Project.
  • Add modules Xafari.Editors.Web and Xafari.Web to the Web Application Project.
  • Invoke Model Editor. Navigate to BOModel|ViewIdPropertyEditorSample.Module.BusinessObjects|ObjectWithStringViewId|OwnMembers|ViewId node. Set PropertyEditorType property to Xafari.Editors.Win.WinViewIdPropertyEditor (or Xafari.Editors.Web.WebViewIdPropertyEditor).

viewid_property_editor_3

  • To see the result, run the WinForms or ASP.NET application.

Windows Forms:

viewid_property_editor_4

ASP.NET:

viewid_property_editor_5

  • You can set the type of View that will be visible in the lookup list. For this purpose use DataSourceCriteria property as shown in the image below.

viewid_property_editor_6

The following filter criteria are available:

  • ListView
  • DetailView
  • Any
  • DashboardView

You can download the solution used in this lesson.