Glossary Item Box
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.
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.
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.
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 |
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.
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.
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:
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:
In CSS:
.RowStyle{background-color:Blue;}
.RowAltStyle{background-color:White;}
.HeaderStyle{background-color:Green;}
In Visual Basic:
Me.UltraWebGrid1.DisplayLayout.RowStyleDefault.BackgroundImage = "./myimage.gif"
In C#:
this.UltraWebGrid1.DisplayLayout.RowStyleDefault.BackgroundImage = "./myimage.gif";
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.
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.