Skip to main content
.NET Framework 4.5.2+

AppearanceController.CustomApplyAppearance Event

Occurs before the conditional appearance is applied to the target UI element.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

Assembly: DevExpress.ExpressApp.ConditionalAppearance.v24.1.dll

Declaration

public event EventHandler<ApplyAppearanceEventArgs> CustomApplyAppearance

Event Data

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

Property Description
AppearanceItems Gets the list of resulting items that were calculated by each appearance rule.
AppearanceObject The appearance that is currently applied to the target UI element.
ContextObjects An object(s) to whose property a conditional appearance is currently applied. If the target item is an Action, it’s the selected object(s) of the current View.
EvaluatorContextDescriptor Gets the EvaluatorContextDescriptor object that is used to supply metadata on the specified type to the ExpressionEvaluator objects.
Handled Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.
Item A UI element whose appearance is about to be refreshed by applying the appropriate conditional appearance rules.
ItemName The name of the UI element whose appearance is about to be refreshed by applying conditional appearance rules.
ItemType The type of the UI element whose appearance is about to be refreshed by applying conditional appearance rules.
View Obsolete. Gets the current View.
ViewInfo Gets the information related to the current View.

Remarks

This event is raised by the AppearanceController.RefreshItemAppearance method. The resulting appearance to be applied is represented by an AppearanceObject. You can access and customize this object in the CustomApplyAppearance event handler, using the ApplyAppearanceEventArgs.AppearanceObject parameter. To determine to which item and in which context the conditional appearance is going to be currently applied, use the event handler’s ApplyAppearanceEventArgs.Item, ApplyAppearanceEventArgs.ItemName, ApplyAppearanceEventArgs.ItemType and ApplyAppearanceEventArgs.ContextObjects parameters.

Important

Set the Handled parameter to true if appearance settings are completely processed by your code. Assign false if you want to keep the default processing code. Note that in this case, the default processing code can override your changes.

To learn which item types may present as appearance items, see the following table:

Item

Description

Supported Appearance types

AppearanceObjectAdapter

Provides access to the arguments of the GridView.RowCellStyle event handled by the GridListEditor. To access the row cell or its appearance settings, use the RowCellStyleEventArgs object returned by the adapter’s Data property.

Provides access to the arguments of the TreeList.NodeCellStyle event handled by the TreeListEditor. To access the node cell or its appearance settings, use the GetCustomNodeCellStyleEventArgs object returned by the adapter’s Data property.

IAppearanceFormat

TableCellAppearanceAdapter

Provides access to a System.Web.UI.WebControls.TableCell when its appearance is formatted by the ASPxGridListEditor or ASPxTreeListEditor. To access the cell, use the adapter’s Data property.

Provides access to the arguments of the ASPxGridView.HtmlDataCellPrepared event handled by the ASPxGridListEditor. To access the row cell or its appearance settings, use the ASPxGridViewTableDataCellEventArgs object returned by the adapter’s Data property.

IAppearanceFormat

GridViewRowCellStyleEventArgsAppearanceAdapter, GridViewCancelEventArgsAppearanceAdapter, GridViewCancelEventArgsAppearanceAdapterWithReset

Provides access to the GridView and EventArgs objects passed to ColumnView.ShowingEditor and GridView.RowCellStyle events to customize the appearance of grid cells and editors.

IAppearanceFormat, IAppearanceEnabled

NodeCellStyleEventArgsAppearanceObjectAdapter

Provides access to the TreeList and GetCustomNodeCellStyleEventArgs objects, when the appearance of the Tree List cells.

IAppearanceFormat

ASPxGridInplaceEditAppearanceAdapter

Provides access to the arguments of the ASPxGridView.HtmlRowPrepared event handled by the ASPxGridListEditor. To access the row or its appearance settings, use the ASPxGridViewTableRowEventArgs object returned by the adapter’s Data property.

Provides access to the ASPxGridViewEditFormEventArgs arguments of the ASPxGridView.HtmlEditFormCreated event handled by the ASPxGridListEditor.

IAppearanceFormat, IAppearanceEnabled

WebLayoutItemAppearanceAdapter

Provides access to a LayoutItemTemplateContainer, LayoutGroupTemplateContainer or TabbedGroupTemplateContainer when it’s processed by the WebLayoutManager and when the AppearanceController.Refresh method is invoked. To access a container and its control, use the adapter’s Data property.

IAppearanceFormat, IAppearanceVisibility

WinLayoutItemAppearanceAdapter

Provides access to a XAFLayoutItemInfo object representing a layout item or group when it’s created by the WinLayoutManager and when the AppearanceController.Refresh method is invoked. To access the XAFLayoutItemInfo object, use the adapter’s Data property.

IAppearanceFormat, IAppearanceVisibility

DevExpress.ExpressApp.Editors.ColumnWrapper

Represents a column in a GridListEditor, TreeListEditor, ASPxGridListEditor and ASPxTreeListEditor. The conditional appearance is applied to each column when the List Editor’s control is created.

IAppearanceVisibility

PropertyEditor

The conditional appearance is applied to all PropertyEditor class’ descendants when their controls are created and when the AppearanceController.Refresh method is invoked.

IAppearanceEnabled, IAppearanceVisibility

DXPropertyEditor

The conditional appearance is applied to all DXPropertyEditor class’ descendants when their controls are created and when the AppearanceController.Refresh method is invoked.

IAppearanceFormat

StaticText

The conditional appearance is applied to Static Text detail view items when their controls are created and when the AppearanceController.Refresh method is invoked.

IAppearanceFormat

WebPropertyEditor

The conditional appearance is applied to all WebPropertyEditor class’ descendants when their controls are created and when the AppearanceController.Refresh method is invoked.

IAppearanceFormat

ActionAppearanceItem

The conditional appearance is applied to ActionAppearanceItems when the AppearanceController.Refresh method is invoked. To access the affected Action, use the ActionAppearanceItem’s Data property.

IAppearanceEnabled, IAppearanceVisibility

Refer to the How to: Customize the Conditional Appearance Module Behavior topic to see an example of handling this event.

Note

Instead of directly accessing the editor’s control, you can customize the appearance object. Iterate through the ApplyAppearanceEventArgs.AppearanceItems list to select the required item.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomApplyAppearance event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also