Current filter:
                                You should refresh the page.
                                  • Description:
                                    There are many questions that may arise when a user performs an upgrade, or starts using DX controls. Many of them are related to Themes and visual site appearance. This article answers questions, frequently asked in this regard.

                                    Answer:
                                    Q: Is it better to use themes or auto formats?
                                    A: Themes are more preferable than auto formats, because using themes it is easier to maintain the ASPX markup, which doesn't contain embedded styles. Of course, this doesn't mean that you shouldn't use styles anymore. No, you can apply a required theme to a page if you wish to have controls with different appearance. There are two ways: if you wish to use a new appearance more than once, it is better to create a skin file; if not, simply modify your markup.
                                    Q: Why doesn't the ProjectConverter tool update all my styles and skins?
                                    A: After each major upgrade there is a chance that the previous styling will be changed. For example, from v2009 vol 3, all DX controls started using CSS Sprites, and almost all skin files use some new properties. The ProjectConverter is a tool that reduces possible risks when an upgrade is performed, for example, it modifies the version of used assemblies, registers a handler and so on. This tool knows nothing about previous and current styles, and about differences between them. It wasn't designed to scan all sources and modify styles that were used in older versions; it doesn't modify page layout either, because this process might break the existing functionality.
                                    Q: I've upgraded from the 8.3 (or 11.2, or 15.1) version, and almost all my styles disappeared. Why? Is it a bug?
                                    A: Generally, the answer is "No". There might be several reasons why you've lost required appearance:
                                    - you used auto formats, which were changed due to the control's styling design. For example, you should set the SpriteCssFilePath property to a correct value;
                                    - you haven't updated skin files in the App_Themes directory with the ASPxThemeDeployer tool;
                                    - you might be using custom styles or themes from the v2009 vol 1 (and earlier) version, and after updating some CSS classes were changed. There are two possible solutions:

                                    1. If you didn't modify our themes, you can simply clean the App_Themes directory and install skin files only via the ASPxThemeDeployer tool. You don't need CSS and images, because all of them will be obtained from the ASPxThemes.dll file (ASP.NET Themes In DLL);
                                    2. Custom styles are hard to upgrade, because a control's rendering might have been modified, and some elements were removed, or new elements were added. Probably, your styles don't affect the new HTML page layout, or are redefined by other styles. It is hard to determine the real cause without a detailed examination including some web tools, such as FireBug.
                                    Q: What should I do to avoid possible styling problems after an upgrade?
                                    A: Preferable steps are the following: remove all styles for all controls via the "Auto Format->Remove Formatting", and apply themes via the App_Themes directory. This action might remove other properties, which can be applied to skins, such as Width. This is normal, because all of them take part in creating a particular appearance. So, you should use this option carefully, because you might lose required properties values.
                                    Q: Why do I need the "only skin files" checkbox in the ASPxThemesDeployer tool?
                                    A: When this option is disabled, the tool copies all images and styles files to your project. This option is required if you wish to unpack all data from the ASPxThemes.dll assembly and modify it. If you do this, resource merging won't be performed, because all used CSS files will be embedded into the HTML page. If you wish, you can disable the ASPxThemes.dll in this case: S33197.
                                    [XML]
                                    <appSettings> <add key="DXEnableThemesAssembly" value="False"/> </appSettings>

                                    Q: Is the ASPxThemes.dll still necessary to enable the components correct rendering?
                                    A: This file is required for themes only, you don't need it with the default theme. All styles and images are placed there.
                                    Q: If I want to have a button with the "Aqua" auto format and a grid with the "BlackGlass" auto format on the same page, what should I do?
                                    A: You should decide which theme you wish to use within the entire site. If you use the Aqua theme, you should apply the BlackGlass auto format to the grid, and vice versa. You can also make a copy of the ASPxGridView.skin file from the BlackGlass and assign a skin ID. Then you'll be able to use two themed controls. When you apply an auto format and find out that it isn't applied, and the control has the site's theme still applied, you should assign a fake SkinID value to the control:

                                    [ASPx]
                                    <dxe:ASPxButton ID="ASPxButton2" runat="server" Text="ASPxButton" CssFilePath="~/App_Themes/RedWine/{0}/styles.css" CssPostfix="RedWine" SkinID="tmp"> </dxe:ASPxButton>

                                    Q: Various formats have different sizes (widths and heights) at design time. At design time all the components are rendered without formatting, so I'm having trouble positioning various components, since at runtime they will change their width or height. For example, a menu component has a different height when being rendered with the "BlackGlass" format than when rendered with the "Office2003Blue" format. How can I deal with this problem?
                                    A: You are probably assigning the theme via the Theme property. If you wish, you can temporarily assign the StyleSheetTheme property instead, and you'll see the current theme. This is probably incorrect to create a site with themes where you rely on the exact dimensions, because the resulting page might be displayed differently in different browsers (or at different zoom levels).
                                    Q: I've found out that some images disappear in the auto formats window. Is this a bug?
                                    A: No, this isn't a bug. Visual Studio doesn't display PNG images (which are used in sprites) properly. We recommend that you test your site in different browsers that are supported by DevExpress, rather than use IDE's internal browser, which is used for RAD only. However, this issue should be fixed in future versions of DX controls, but if you use custom themes, you might still face it.
                                    Q: Why do I get the "Compiler Error Message: CS0103: The name 'WebResource' does not exist in the current context" exception?
                                    A: Probably you've taken CSS styles from the "CSS Sample" or "Spire CSS Sample" window, that can be shown via the control's smart menu. If you take a look at CSS file, you'll see the following lines:

                                    [CSS]
                                    background-image: url('<%=WebResource("DevExpress.Web.ASPxPivotGrid.Images.sprite.png")%>'); -background-image: url('<%=WebResource("DevExpress.Web.ASPxPivotGrid.Images.sprite.gif")%>'); /* for IE6 */

                                    The WebResource attribute is used by the ASPxHttpHandlerModule to locate required resource in the ASPxThemes.dll assembly and replace the server lines via the runtime values:

                                    [CSS]
                                    background-image: url("/DXR.axd?r=1_20");

                                    This process works if resources are passed through the ASPxHttpHandlerModule that will analyze the file before sending it to the client. When these styles are available in other places (in the ASPX page in the <head> section), the module isn't able to process them, and Visual Studio doesn't know what to do, either. That is why you see these warnings in the output window.
                                    All you need is to modify them: you should extract the CSS sprite from a control, and then provide a real path for this image in the CSS style. For example:

                                    [CSS]
                                    background-image: url('sprite.png'); -background-image: url('sprite.gif'); /* for IE6 */

                                    Q: Why do styles disappear in IE browser?
                                    A: Usually, styles disappear in the IE family browsers due to several limitations that do not occur in FireFox, Google Chrome, Apple Safari and Opera browsers. These limitations are:

                                    1. It is not possible to link more than 31 stylesheet files to a single HTML file in the < head> tag: A webpage that uses CSS styles does not render correctly in Internet Explorer.
                                    2. Also, IE cannot process more than 288 kb per a single CSS file: CSS File Size Limit in Internet Explorer 6 / 7 / 8
                                    Unfortunately there are two opposing solutions. And each of them depends on the issue you face. For example, usually it is helpful to enable (1) / disable (2) the Resource Merging option, or you might try to remove unnecessary styles from a problematic page. In many cases, people may need styles for the ASPxMenu control. So it would be better to cut these styles from required theme, so our controls will not link stylesheet files of the entire ASPxperience suite.

                                    See also:
                                    ASP.NET Themes and Skins
                                    Themes In ASP.NET 2.0
                                    Creating a Custom Theme Assembly
                                    Applying a Theme from a Custom Theme Assembly
                                    How to resolve issues with custom themes after upgrading
                                    Sneak Peek: Enhanced ASP.NET Themes DLL Performance
                                    Using Custom CSS Sprites - Using a separate sprite CSS file.

                                0 Solutions

                                Creation Date Importance Sort by