Skip to main content

View.CustomizeViewShortcut Event

Occurs when the View.CreateShortcut method creates a View Shortcut for the current View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v25.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler<CustomizeViewShortcutArgs> CustomizeViewShortcut

Event Data

The CustomizeViewShortcut event's data class is CustomizeViewShortcutArgs. The following properties provide information specific to this event:

Property Description
ViewShortcut Specifies the created View Shortcut.

Remarks

Handle this event to add custom key/value pairs to View Shortcuts when they are created. Note that you should also add custom keys to the ViewShortcut.EqualsDefaultIgnoredParameters list, to ensure that they do not break built-in functionalities.

Important

Do not modify values corresponding to keys that already exist in newly created View Shortcuts. XAF uses this information internally, and its modification may cause issues with built-in functionalities.

Follow the steps below to handle the CustomizeViewShortcut event to add a filter expression to a List View Shortcut.

This code changes the default behavior of WinForms applications as follows:

  • A WinForms application with the MDI UI type opens List Views with the same ID and different filters in different tabs. (Default behavior: an application activates an existing tab if its List View has the same ID as a filtered View.)

Note

If a filter expression contains special characters (blanks or punctuation marks) it can be misinterpreted in an HTTP stream. To avoid this, use the HttpUtility.UrlEncode method to write a criteria string to a ViewShortcut and the HttpUtility.UrlDecode method to get a CriteriaOperator from this ViewShortcut.

See Also