ComponentOne WebMenus and WebBars for ASP.NET (2.0) Search HelpCentral 

ItemStyle Class

The C1WebItemStyle class is referred as the ItemStyle object in the design editors. A few of its properties inherit from either the C1WebCustomItemStyle or the System.Web.UI.WebControls.Style class.

The C1WebItemStyle class provides a number of useful item style properties including:

 

C1WebItemStyle Properties

BackColor

ImageUrl

BackImageUrl

ItemAlign

BorderColor

ItemImagePosition

BorderStyle

LabelPaddingBottom

BorderWidth

LabelPaddingLeft

CssClass

LabelPaddingRight

Font

LabelPaddingTop

ForeColor

LabelBorderImageUrl

Height

RightBorderImageUrl

ImageTextSpacing

 

 

The next topic section describes each of the common Style, GroupStyle, and ItemStyle properties and provides a few examples that demonstrate how to apply the properties to a C1WebTopicBar.

The Flat controls (C1WebTopicBar, C1WebToolBar, C1WebTabStrip) are made up of groups. The groups may or may not have items. Therefore, when you assign a property to a specific item you must specify the Groups object first. The two code examples below provide a generic example how to apply ItemStyle properties to specific items.

Note: The text, topicbar represents the local variable name for the C1WebTopicBar control and the text, PropertyName, represents a property from the ItemStyle object.

Flat Control Type

The following code example below shows how to apply the ItemStyle property to a specific item using the Flat controls:

·      Visual Basic

CType(topicbar.Groups(0).Items(0), C1WebLinkItem).ItemStyle.PropertyName

·      C#

((C1WebLinkItem)topicbar.Groups[0].Items[0]).ItemStyle.PropertyName

·      Delphi

((C1WebLinkItem)topicbar.Groups[0].Items[0]).ItemStyle. PropertyName;

Tree View Control Type

The following code shows how to apply the ItemStyle property to a specific item using the Tree type controls: C1WebMenu and C1WebTreeView:

·      Visual Basic

CType(menu.Items(0), C1WebMenuItem).ItemStyle.PropertyName

·      C#

((C1WebMenuItem)menu.Items[0]).ItemStyle.PropertyName;

·      Delphi

((C1WebMenuItem)menu.Items[0]).ItemStyle.PropertyName;

The code example below shows how to apply the ItemStyle property to a subitem in the tree or menu using the C1WebMenu or C1WebTreeView controls:

·      Visual Basic

CType(CType(menu.Items(0), C1WebMenuItem)SubMenu.Items(0), C1WebMenuItem).ItemStyle.PropertyName

·      C#

((C1WebMenuItem)menu.Items[0].SubMenu.Items[0]).ItemStyle.PropertyName;

·      Delphi

((C1WebMenuItem)menu.Items[0].SubMenu.Items[0]).ItemStyle.PropertyName;

The following section lists the properties for each class and provide an example and a description of each property. The settings for the GroupStyle and ItemStyle properties are applied through the use of Visual Basic, C#, and Delphi code.


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