New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

This partial class defines the rendering RadToolBarItem.

The RadToolBar control is made up of a list of toolbar items represented by RadToolBarItem objects (RadToolBarButton, RadToolBarDropDown, RadToolBarSplitButton). All toolbar items are stored in the Items collection of the toolbar. You can access the toolbar to which the item belongs by using the ToolBar property.

To create the toolbar items for a RadToolBar control, use one of the following methods:

Each toolbar item has a Text property. The Button items (RadToolBarButton and RadToolBarSplitButton) have a Value property. The value of the Text property is displayed in the RadToolBar control, while the Value property is used to store any additional data about the toolbar item.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public abstract class RadToolBarItem : ControlItem, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IMarkableStateManager, IStateManager, INamingContainer, IXmlSerializable

Inheritance: objectControlWebControlControlItemRadToolBarItem

Derived Classes: RadToolBarButtonRadToolBarDropDownRadToolBarSplitButton

Implements: IAttributeAccessorIComponentIControlBuilderAccessorIControlDesignerAccessorIDataBindingsAccessorIDisposableIExpressionsAccessorIMarkableStateManagerINamingContainerIParserAccessorIStateManagerIUrlResolutionServiceIXmlSerializable...

Inherited Members ControlItem.SetChildrenDirty()ControlItem.LoadChildViewState(object)ControlItem.SaveChildViewState()ControlItem.TrackChildViewState()ControlItem.GetHierarchicalIndex()ControlItem.SetItemContainer(ControlItemContainer)ControlItem.CreateChildItemCollection()ControlItem.ReadXml(XmlReader)ControlItem.WriteXml(XmlWriter)ControlItem.IsChildControl(Control)ControlItem.GetAllChildren<TControlItem>()ControlItem.GetChildren<TControlItem>(Predicate<TControlItem>)ControlItem.FindChild<TControlItem>(Predicate<TControlItem>)ControlItem.DataItemControlItem.ValueControlItem.IndexControlItem.AccessKeyControlItem.TemplateControlItem.ContainerControlItem.RenderingCompatibilityControlItem.ChildrenControlItem.PropertyMappingsWebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.LoadViewState(object)WebControl.TrackViewState()WebControl.MergeStyle(Style)WebControl.Render(HtmlTextWriter)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.SaveViewState()WebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SupportsDisabledAttributeWebControl.SkinIDWebControl.TabIndexWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.OnInit(EventArgs)Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.OnLoad(EventArgs)Control.OnPreRender(EventArgs)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.CreateChildControls()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
protected RadToolBarItem()

Properties

Gets or sets the Cascading Style Sheet (CSS) class applied when the toolbar item is clicked.

C#
public string ClickedCssClass { get; set; }
Property Value:

The CSS class applied when the toolbar item is clicked. The default value is String.Empty.

Example:
C#
By default the visual appearance of clicked toolbar items is defined in the skin CSS
file. You can use the <strong>ClickedCssClass</strong> property to specify unique
appearance for the toolbar item when it is clicked.

Gets or sets the path to an image to display for the item when the user clicks it.

C#
public string ClickedImageUrl { get; set; }
Property Value:

The path to the image to display when the user clicks the item. The default value is empty string.

Use the ClickedImageUrl property to specify the image that will be used when the user clicks the item. If the ClickedImageUrl property is set to empty string the image specified by the ImageUrl property will be used. Use "~" (tilde) when referring to images within the current ASP.NET application.

Example:
C#
<p>&lt;telerik:RadToolBar id="RadToolBar1" runat="server"&gt;<br />
&lt;Items&gt;<br />
&lt;telerik:RadToolBarDropDown ImageUrl="~/Img/inbox.gif"
<strong>ClickedImageUrl="~/Img/inboxClicked.gif"</strong> Text="DropDown1" &gt;
    &lt;Items&gt;<br />
           &lt;telerik:RadToolBarButton Text="Mail1" <strong>ClickedImageUrl="~/Img/mail1Clicked.gif"</strong>
           /&gt;
    &lt;/Items&gt;<br />
   &lt;/telerik:RadToolBarDropDown&gt;/<br />
&lt;/Items&gt;<br />
&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the Cascading Style Sheet (CSS) class applied when the toolbar item is disabled.

C#
public string DisabledCssClass { get; set; }
Property Value:

The CSS class applied when the toolbar item is disabled. The default value is String.Empty.

By default the visual appearance of disabled toolbar items is defined in the skin CSS file. You can use the DisabledCssClass property to specify unique appearance for the toolbar item when it is disabled.

Gets or sets the path to an image to display when the item is disabled.

C#
public virtual string DisabledImageUrl { get; set; }
Property Value:

The path to the image to display when the item is disabled. The default value is empty string.

Use the DisabledImageUrl property to specify the image that will be used when the item is disabled. If the DisabledImageUrl property is set to empty string the image specified by the ImageUrl property will be used. Use "~" (tilde) when referring to images within the current ASP.NET application.

Example:
C#
<p>&lt;telerik:RadToolBar id="RadToolBar1" runat="server"&gt;<br />
&lt;Items&gt;<br />
&lt;telerik:RadToolBarButton ImageUrl="~/Img/inbox.gif"
<strong>DisabledImageUrl="~/Img/inboxDisabled.gif"</strong> Text="Index" /&gt;<br />
&lt;/Items&gt;<br />
&lt;/telerik:RadToolBar&gt;</p>

Gets or sets a value indicating whether the item image should have sprite support.

C#
[ClientControlProperty]
[ClientPropertyName("enableImageSprite")]
public bool EnableImageSprite { get; set; }
Property Value:

True if the item should have sprite support; otherwise False. The default value is False.

Gets or sets the Cascading Style Sheet (CSS) class applied when the toolBar item is focused after tabbing to it, or by using its AccessKey

C#
public string FocusedCssClass { get; set; }
Property Value:

The CSS class applied when the toolBar item is focused. The default value is String.Empty.

By default the visual appearance of focused toolBar items is defined in the skin CSS file. You can use the FocusedCssClass property to specify unique appearance for the toolBar item when it is focused.

Example:
C#
<p>
   &lt;style type="text/css"&gt;
   .myFocusedCssClass .rtbText
   {
       font-weight:bold !important;
       color:red !important;
   }
   &lt;/style&gt;
   &lt;telerik:RadToolBar id="RadToolBar1" runat="server"&gt;<br />
&lt;Items&gt;<br />
&lt;telerik:RadToolBarButton
<strong>FocusedCssClass="myFocusedCssClass"</strong> Text="Bold" /&gt;<br />
&lt;/Items&gt;<br />
&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the path to an image to display when the user focuses the item either by tabbing to it or by using the AccessKey

C#
public virtual string FocusedImageUrl { get; set; }
Property Value:

The path to the image to display when the user user focuses the item either by tabbing to that it or by using the AccessKey. The default value is empty string.

Use the FocusedImageUrl property to specify the image that will be used when the item gets the focus after tabbing or using its AccessKey. If the FocusedImageUrl property is set to empty string the image specified by the ImageUrl property will be used. Use "~" (tilde) when referring to images within the current ASP.NET application.

Example:
C#
<p>&lt;telerik:RadToolBar id="RadToolBar1" runat="server"&gt;<br />
&lt;Items&gt;<br />
&lt;telerik:RadToolBarButton ImageUrl="~/Img/bold.gif"
<strong>FocusedImageUrl="~/Img/boldFocused.gif"</strong> Text="Bold" /&gt;<br />
&lt;/Items&gt;<br />
&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the Cascading Style Sheet (CSS) class applied when the user moves the mouse over the toolbar item.

C#
public string HoveredCssClass { get; set; }
Property Value:

The CSS class applied when the user moves the mouse over the toolbar item. The default value is String.Empty.

By default the visual appearance of a hovered toolbar items is defined in the skin CSS file. You can use the HoveredCssClass property to specify unique appearance for the toolbar item when it is hovered.

Gets or sets the path to an image to display when the user moves the mouse over the item.

C#
public virtual string HoveredImageUrl { get; set; }
Property Value:

The path to the image to display when the user moves the mouse over the item. The default value is empty string.

Use the HoveredImageUrl property to specify the image that will be used when the user moves the mouse over the item. If the HoveredImageUrl property is set to empty string the image specified by the ImageUrl property will be used. Use "~" (tilde) when referring to images within the current ASP.NET application.

Example:
C#
<p>&lt;telerik:RadToolBar id="RadToolBar1" runat="server"&gt;<br />
&lt;Items&gt;<br />
&lt;telerik:RadToolBarButton ImageUrl="~/Img/inbox.gif"
<strong>HoveredImageUrl="~/Img/inboxOver.gif"</strong> Text="Index" /&gt;<br />
&lt;/Items&gt;<br />
&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the ID.

C#
[Browsable(false)]
public string ID { get; set; }
Property Value:

The ID.

Gets or sets the position of the item image according to the item text.

C#
public ToolBarImagePosition ImagePosition { get; set; }
Property Value:

The position of the item image according to the item text. The default value is ToolBarImagePosition.Left.

Example:
C#
<p>&lt;telerik:RadToolBar id="RadToolBar1" runat="server"&gt;<br />
&lt;Items&gt;<br />
&lt;telerik:RadToolBarButton ImageUrl="~/Img/bold.gif"
<strong>ImagePosition="Right"</strong> Text="Bold" /&gt;<br />
&lt;/Items&gt;<br />
&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the path to an image to display for the item.

C#
public virtual string ImageUrl { get; set; }
Property Value:

The path to the image to display for the item. The default value is empty string.

Use the ImageUrl property to specify the image for the item. If the ImageUrl property is set to empty string no image will be rendered. Use "~" (tilde) when referring to images within the current ASP.NET application.

Example:
C#
<p>The following example demonstrates how to specify the image to display for
a button using the <strong>ImageUrl</strong> property.</p>
<p>
    <p>&lt;telerik:RadToolBar id="RadToolBar1"
    runat="server"&gt;<br />
    &lt;Items&gt;<br />
    &lt;telerik:RadToolBarButton <strong>ImageUrl="~/Img/inbox.gif"</strong> Text="Index"
    /&gt;<br />
    &lt;telerik:RadToolBarButton <strong>ImageUrl="~/Img/outbox.gif"</strong> Text="Outbox"
    /&gt;<br />
    &lt;/Items&gt;<br />
    &lt;/telerik:RadToolBar&gt;</p>
</p>
C#
protected RadToolBarItem.RendererBase ItemRenderer { get; }

Gets or sets the Cascading Style Sheet (CSS) class applied on the outmost element (<LI>).

C#
public string OuterCssClass { get; set; }
Property Value:

The CSS class applied on the wrapping element (<LI>). The default value is empty string.

You can use the OuterCssClass property to specify unique appearance for the item, or to insert elements that are before/after the link element.

Gets or Sets OverFlow state

C#
[ClientControlProperty]
[ClientPropertyName("overFlow")]
public ToolBarOverflow OverFlow { get; set; }

Gets or Sets ShowImage state

C#
[ClientControlProperty]
[ClientPropertyName("showImage")]
public virtual ToolBarShowPosition ShowImage { get; set; }

Gets or Sets ShowText state

C#
[ClientControlProperty]
[ClientPropertyName("showText")]
public virtual ToolBarShowPosition ShowText { get; set; }

Gets or sets the Cascading Style Sheet (CSS) class that contains the sprite image for this item and the positioning for it.

C#
public string SpriteCssClass { get; set; }
Property Value:

The CSS that is used in sprite image scenarios. String.Empty.

By default, the image in an item is defined by the ImageUrl property. You can use SpriteCssClass to specify a class that will position a sprite instead of using image.

C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

Gets or sets the text displayed for the current item.

C#
public override string Text { get; set; }
Property Value:

The text an item in the RadToolBar control displays. The default is empty string.

Overrides: ControlItem.Text

Use the Text property to specify or determine the text an item displays displays in the RadToolBar control.

Gets the RadToolBar instance which contains the item.

C#
[Browsable(false)]
public RadToolBar ToolBar { get; }

Use this property to obtain an instance to the RadToolBar object containing the item.

Methods

C#
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: WebControl.AddAttributesToRender(HtmlTextWriter)

C#
protected abstract RadToolBarItem.RendererBase CreateRenderer()
Returns:

RadToolBarItem.RendererBase

C#
protected abstract string GetCurrentImageUrl()
Returns:

string

C#
protected override void LoadFromDictionary(IDictionary<string, object> dictionary)
Parameters:dictionaryIDictionary<string, object>

Overrides: ControlItem.LoadFromDictionary(IDictionary<string, object>)

C#
protected void ReadXmlForChildren(XmlReader reader)
Parameters:readerXmlReader
C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: WebControl.RenderContents(HtmlTextWriter)

C#
protected static void WriteXmlForChildren(XmlWriter writer, RadToolBarItemCollection children)
Parameters:writerXmlWriterchildrenRadToolBarItemCollection