Skip to main content
Tab

ASPxMenuBase.ApplyItemStyleToTemplates Property

Gets or sets a value that specifies whether the styles defined for menu items can be applied to templated menu items.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public virtual bool ApplyItemStyleToTemplates { get; set; }

Property Value

Type Default Description
Boolean false

true if item styles apply to templated menu items; otherwise, false.

Remarks

Use the ApplyItemStyleToTemplates property to control whether the syles defined for menu items affect the appearance of templated menu items.

If this property is set to false (the default value), the appearance of menu items, which are rendered using templates (such as the ASPxMenuBase.ItemTemplate or MenuItem.Template), is not affected by style settings defined for menu items (via the ASPxMenuBase.ItemStyle, ASPxMenuBase.SubMenuItemStyle or MenuItem.SubMenuItemStyle property).

Set the ApplyItemStyleToTemplates property to true to make templated menu items inherit some item style settings, such as background images, paddings, etc. This allows you to keep the outward appearance of templated menu items identical to other items within the menu control.

The image below demonstrates how this property’s setting affects the appearance of the second root item, which is rendered using a template consisting of a standard CheckBox control:

ASPxMenu_ApplyItemStylesToTemplates.png

See Also