KB Article KA18643
Visible to All Users

ASP.NET - Why some control settings are not in effect if the Theme property is used

Description:
I am trying to change the "X" property of the "Y" control, but not able to. At design time, this property is applied properly, but my changes are not in effect when I run my application. Note that I use the Theme property for the site.

Answer:
This issue is caused by the fact that our skin files rewrite some control properties (i.e. ASPxMenu.ItemImagePosition, ASPxRoundPanel.ContentPaddings, etc.). When you apply a theme to a page or site using the Theme property, remember that control properties declared in a corresponding skin file have higher priority. However, there are several ways to solve this issue.
1. Apply the theme using the StyleSheetTheme property. This way, the control markup on a page overwrites properties declared in the skin file. For example:

XML
<devExpress> <themes enableThemesAssembly="true" styleSheetTheme="Aqua" /> </devExpress>

or

ASPx
<pages ... styleSheetTheme="Aqua">

Referring to MSDN, I would like to say that the StyleSheetTheme property specifies the name of a theme that is applied to a page early in the page life cycle, whereas the Theme property specifies the name of a theme that is applied to a page later in the page life cycle. This means that settings on the page have higher priority than settings in the style sheet theme.

2. Create a new theme based on the default one using the ASPxThemeBuildrer tool and re-define required properties. Here is a link to the help topic:
Creating a New Theme: Modify Theme

3. Create a custom skin with ASPxThemeBuilder. Re-define the required properties in this skin file and set the new skin ID to the control's SkinIDproperty.

4. Set the necessary properties in the control's Init event handler. For example:

C#
protected void dv_Init(object sender, EventArgs e) { ASPxDataView dv = (ASPxDataView)sender; dv.PagerSettings.ShowNumericButtons = false; }
Visual Basic
Protected Sub dv_Init(sender As Object, e As EventArgs) Dim dv As ASPxDataView = DirectCast(sender, ASPxDataView) dv.PagerSettings.ShowNumericButtons = False End Sub

For information, see the following topics:
How to: Apply ASP.NET Themes
How to: Apply ASP.NET Themes Programmatically
Apply a Theme with the ASP.NET Mechanism
Apply a Theme with the DevExpress Mechanism

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.