ComponentOne ReportViewer for ASP.NET AJAX: ReportViewer for ASP.NET AJAX Task-Based Help > Setting the Visual Style

Setting the Visual Style

The control includes several built-in visual styles, including Vista and Office 2007 styles, to style your application. For more information about available styles, see Visual Styles. You can easily change visual styles in Source view, in Design view, and in code using the VisualStyle property. The examples below set the VisualStyle to Vista.

Note that when you change the VisualStyle property the VisualStylePath and C1ReportViewer.CssClass properties also change.

In Source View

In Source view add VisualStyle="Vista" to the <cc1:C1ReportViewer> tag so it appears similar to the following:

<cc1:C1ReportViewer ID="C1ReportViewer1" runat="server" VisualStyle="Vista" />

From the Tasks menu

You can select a visual style to apply from the C1ReportViewer Tasks menu:

1.   Click on the C1ReportViewer's smart tag to open the C1ReportViewer Tasks menu.

2.   Click the Visual Style drop-down arrow.

3.   In the Visual Style drop-down box select a Visual Style, for example Vista.

The Visual Style you chose will be applied to the C1ReportViewer control.

From the Properties window

You can select a visual style to apply from the Properties window:

1.   Click on the C1ReportViewer control to select it.

2.   Navigate to the Properties window and to the VisualStyle property.

3.   Type in a style to apply, for example "Vista".

The Visual Style you choose will be applied to the C1ReportViewer control.

In Code

Add the following code to the Page_Load event to set the VisualStyle property to Vista:

      Visual Basic

Me.C1ReportViewer1.VisualStyle = "Vista"

      C#

this.C1ReportViewer1.VisualStyle = "Vista";


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.