Skip to main content
.NET Framework 4.6.2+

ListEditor.ProtectedContentText Property

Specifies the text that is used by a List Editor to display a property which is prohibited for viewing by the current user.

Namespace: DevExpress.ExpressApp.Editors

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public string ProtectedContentText { get; set; }

Property Value

Type Description
String

A string value that represents text to be displayed by a List Editor if a user does not have permission to view an object’s property. The default value is specified by the ProtectedContentText property of the Application Model’s Application node.

Remarks

Use this property to set the text that will be displayed instead of an actual value of a property that is prohibited for viewing by the current user by the Security System. This text is not available at the data source level. Protected properties return default type values instead of actual values. The null (Nothing in VB) value is returned for reference properties, zero - for integer properties, DateTime.MinValue - for DateTime properties.

Example

This example demonstrates a Controller which sets different ProtectedContentText values for different List Views.

If the current List View displays objects of the ProtectedContentRootObject type, the ProtectedContentText property’s value is changed to “You cannot view inaccessible properties”.

The image below shows the resulting List View’s List Editor:

ProtectedContentText

using System;
using DevExpress.ExpressApp;

public partial class CustomProtectedStrings : ViewController {

   public CustomProtectedStrings() {           
      TargetViewType = ViewType.ListView;
      Activated += this.CustomProtectedStrings_Activated;
   }

   private void CustomProtectedStrings_Activated(object sender, EventArgs e) {
      if ((View as ListView).ObjectType == typeof(ProtectedContentRootObject)) {
         (View as ListView).Editor.ProtectedContentText = 
            "You cannot view inaccessible properties";
      }           
   }
}
See Also