Breaking Changes in WebGrid

Glossary Item Box

Infragistics® NetAdvantage® for ASP.NET (CLR 2.0)

Breaking Changes in WebGrid

This topic provides information on breaking changes that were made to WebGrid. As developers using WebGrid, you should be aware of these changes before upgrading your version of the NetAdvantage for ASP.NET product.

2007 Volume 2

If you are upgrading your existing ASP.NET project to 2007 Volume 2, take note of the following breaking changes that were made to WebGrid.

Renamed Style Properties

Some style properties in WebGrid's DisplayLayout and Band objects have been marked as obsolete. This change was necessary to avoid problems with Microsoft® Visual Studio® 2005 serializing properties named Style at design time. The simplest and easiest work around is to set any WebGrid property at design time after upgrading an existing project to 2007 Volume 2. This action ensures that the old properties are renamed automatically when WebGrid is serialized to the Web form.

Note: Although your Web project will compile and run, you will get a warning message when setting any of these properties at run time. You should use the new property name to avoid any future issues because the old properties will eventually be removed from WebGrid. In addition, the old property names are not shown in Visual Studio's IntelliSense™.

The following properties (listed in alphabetical order) have been renamed:


Prior to 2007 Volume 2 In 2007 Volume 2 and later
AddNewBox.Style AddNewBox.BoxStyle
AddNewRow.Style AddNewRow.RowStyle
GroupByBox.Style GroupByBox.BoxStyle
Pager.Style Pager.PagerStyle

Removed CaseSensitiveSort Property

2007 Volume 1

If you are upgrading your existing ASP.NET project to 2007 Volume 1, take note of the following breaking changes that were made to WebGrid.

Applying Styles Using Cascading Style Sheets (CSS)

If you are using CSS to set certain styles for your WebGrid, they may not appear as expected from reading the CSS definition. This is most commonly encountered when upgrading an existing ASP.NET project, using an earlier version of the NetAdvantage for ASP.NET controls, to 2007 Volume 1. However, it can also happen when creating new Web applications. These changes to WebGrid were required to make the control work with the Application Styling Framework™ (ASF).

Prior to 2007 Volume 1, when using the CssClass properties on Style objects, WebGrid would determine the "lowest common" style for a particular element and apply only that specific CssClass to the element. However, with the introduction of the ASF, we've implemented the ability to have multiple CSS classes to the same element and layer them in proper order.

When applying multiple CSS classes to the same element, standard HTML cascading rules are applied. If two rules have the same importance, origin and specificity, the last rule specified is the one that takes precedence. For WebGrid, this means that if you are setting multiple CssClass properties that can apply to a specific element, they are applied in the order they are found in your CSS file. The latest rule will always override any rule applied earlier in the file.

For more information on CSS cascading order rules, see Section 6 of the CSS2 Specification on the World Wide Web Consortium's Web site.

Note: For a basic overview of the order in which styles are applied to WebGrid, see WebGrid Style Inheritance.

Consider the following scenario in which WebGrid has specific styles applied to it:


In Visual Basic:

Me.UltraWebGrid1.DisplayLayout.RowStyleDefault.CssClass = "RowStyle"
Me.UltraWebGrid1.DisplayLayout.RowAlternateStyleDefault.CssClass = "RowAltStyle"
Me.UltraWebGrid1.DisplayLayout.HeaderStyleDefault.CssClass = "HeaderStyle"

In C#:

this.UltraWebGrid1.DisplayLayout.RowStyleDefault.CssClass = "RowStyle";
this.UltraWebGrid1.DisplayLayout.RowAlternateStyleDefault.CssClass = "RowAltStyle";
this.UltraWebGrid1.DisplayLayout.HeaderStyleDefault.CssClass = "HeaderStyle";

Prior to 2007 Volume 1, you could apply the following CSS because the order in which the classes are defined didn't matter:

Note: This CSS is not correct for 2007 Volume 1 and later.

In CSS:

.RowAltStyle{background-color:White;}
.RowStyle{background-color:Blue;}
.HeaderStyle{background-color:Green;}

This CSS would cause all your rows to have a blue background, and your header to have a green background. However, the alternate rows would not appear with a white background.

If you want your alternate rows to appear with a white background, use the following CSS definition instead:

Note: This CSS is correct for 2007 Volume 1 and later.

In CSS:

.RowStyle{background-color:Blue;}
.RowAltStyle{background-color:White;}
.HeaderStyle{background-color:Green;}

Using a Local Image for the BackgroundImage

Note: This change affects only certain types of image settings such as setting a background image on a style object. Other image settings for WebGrid have always worked correctly and should not be affected by this change.

If you are setting the BackgroundImage from any style object using a local image, you need to specify that it is a local image by prepending it with a "./" in front of it. Otherwise, it will resolve to the /ig_common/Images/ path. This change was made to bring WebGrid into consistent compliance with the rest of the NetAdvantage for ASP.NET controls.

For example, if you are setting this property for WebGrid's RowStyleDefault using a local image named myimage.gif, you should use the following example code:

In Visual Basic:

Me.UltraWebGrid1.DisplayLayout.RowStyleDefault.BackgroundImage = "./myimage.gif"

In C#:

this.UltraWebGrid1.DisplayLayout.RowStyleDefault.BackgroundImage = "./myimage.gif";

Note: In Microsoft Visual Studi® 2005 (.NET Framework 2.0), if you created your Web site as a File System, you will not see the image(s) applied from the /ig_common/Images/ path. This is due to the fact that a File System Web site creates its own virtual directory instead of using IIS.

Other

2006 Volume 3

If you are upgrading your existing ASP.NET project to 2006 Volume 3, take note of the following breaking changes that were made to WebGrid. These breaking changes occurred while addressing issues involving themes in CLR 2.0.

Note: You may encounter an error message indicating that a particular set method cannot be found.  If so make sure your application isn't caching itself. To ensure this, clear your Temporary ASP.NET files in your installed framework (i.e., C:\Windows\Microsoft.NET\Framework\<version>\Temporary ASP.NET files).

2006 Volume 1

If you are upgrading your existing ASP.NET project to 2006 Volume 1, take note of the following breaking changes that were made to WebGrid. These breaking changes were created due to performance improvements made to WebGrid.

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 1996-2007 Infragistics, Inc. All rights reserved.

Build Version: 7.2.20072.1063