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

This Class specifies the rendering of RadToolBarSplitButton.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class RadToolBarSplitButton : RadToolBarItem, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IMarkableStateManager, IStateManager, INamingContainer, IXmlSerializable, IRadToolBarButtonContainer, IRadToolBarItemContainer, IControlItemContainer, IRadToolBarButton

Inheritance: objectControlWebControlControlItemRadToolBarItemRadToolBarSplitButton...

Implements: IAttributeAccessorIComponentIControlBuilderAccessorIControlDesignerAccessorIControlItemContainerIDataBindingsAccessorIDisposableIExpressionsAccessorIMarkableStateManagerINamingContainerIParserAccessorIRadToolBarButtonIRadToolBarButtonContainerIRadToolBarItemContainerIStateManagerIUrlResolutionServiceIXmlSerializable...

Inherited Members RadToolBarItem.RenderContents(HtmlTextWriter)RadToolBarItem.AddAttributesToRender(HtmlTextWriter)RadToolBarItem.WriteXmlForChildren(XmlWriter, RadToolBarItemCollection)RadToolBarItem.ReadXmlForChildren(XmlReader)RadToolBarItem.TagKeyRadToolBarItem.ItemRendererRadToolBarItem.ToolBarRadToolBarItem.TextRadToolBarItem.IDRadToolBarItem.ImageUrlRadToolBarItem.HoveredImageUrlRadToolBarItem.SpriteCssClassRadToolBarItem.HoveredCssClassRadToolBarItem.ClickedCssClassRadToolBarItem.ClickedImageUrlRadToolBarItem.DisabledImageUrlRadToolBarItem.DisabledCssClassRadToolBarItem.FocusedCssClassRadToolBarItem.FocusedImageUrlRadToolBarItem.OuterCssClassRadToolBarItem.ImagePositionRadToolBarItem.EnableImageSpriteRadToolBarItem.OverFlowRadToolBarItem.ShowTextRadToolBarItem.ShowImageControlItem.GetHierarchicalIndex()ControlItem.IsChildControl(Control)ControlItem.GetAllChildren<TControlItem>()ControlItem.GetChildren<TControlItem>(Predicate<TControlItem>)ControlItem.FindChild<TControlItem>(Predicate<TControlItem>)ControlItem.DataItemControlItem.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

Initializes a new instance of the RadToolBarSplitButton class.

C#
public RadToolBarSplitButton()

Use this constructor to create and initialize a new instance of the RadToolBarSplitButton class using default values.

Example:
cs-api-definition
RadToolBarSplitButton splitButton = new RadToolBarSplitButton();
splitButton.Text = "News";
splitButton.ImageUrl = "~/News.gif";

RadToolBar1.Items.Add(splitButton);

Initializes a new instance of the RadToolBarSplitButton class with the specified text data.

C#
public RadToolBarSplitButton(string text)
Parameters:textstring

The text of the split button. The Text property is set to the value of this parameter.

Use this constructor to create and initialize a new instance of the RadToolBarSplitButton class using the specified text.

Example:
cs-api-definition
RadToolBarSplitButton splitButton = new RadToolBarSplitButton("News");

RadToolBar1.Items.Add(splitButton);

Properties

Gets a RadToolBarButtonCollection object that contains the child buttons of the split button.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
public RadToolBarButtonCollection Buttons { get; }
Property Value:

A RadToolBarButtonCollection that contains the child buttons of the split button. By default the collection is empty (the split button has no buttons).

Implements: IRadToolBarButtonContainer.Buttons

Use the Buttons property to access the child buttons of the split button. You can also use the Buttons property to manage the children of the current tab. You can add, remove or modify buttons from the Buttons collection.

Example:
cs-api-definition
registerPurchaseSplitButton.Buttons[0].Text = "Cache Purchase";
registerPurchaseSplitButton.Buttons[0].ImageUrl = "~/ToolBarImages/RegisterCachePurchase.gif";

registerPurchaseSplitButton.Buttons[1].Text = "Check Purchase";
registerPurchaseSplitButton.Buttons[1].ImageUrl = "~/ToolBarImages/RegisterCheckPurchase.gif";

Gets or sets a value indicating whether validation is performed when the RadToolBarSplitButton is clicked

C#
public bool CausesValidation { get; set; }
Property Value:

true if validation is performed when the RadToolBarSplitButton is clicked otherwise, false. The default value is true.

Implements: IRadToolBarButton.CausesValidation

By default, page validation is performed when the button is clicked. Page validation determines whether the input controls associated with a validation control on the page all pass the validation rules specified by the validation control. You can specify or determine whether validation is performed when the button is clicked on both the client and the server by using the CausesValidation property. To prevent validation from being performed, set the CausesValidation property to false.

Gets or sets an optional parameter passed to the Command event of the RadToolBar instance along with the associated CommandName

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

An optional parameter passed to the Command event of the RadToolBar instance along with the associated CommandName. The default value is an empty string.

Implements: IRadToolBarButton.CommandArgument

Gets or sets the command name associated with the toolbar button that is passed to the ItemCommand event of the RadToolBar instance.

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

The command name of the toolbar button. The default value is an empty string.

Implements: IRadToolBarButton.CommandName

Gets or sets the index of the button which properties will be used by default when the EnableDefaultButton property set to true.

C#
[Bindable(true)]
public int DefaultButtonIndex { get; set; }
Property Value:

The index of the button which properties will be used by default when the EnableDefaultButton property set to true. The default value is 0

Use the DefaultButtonIndex property to specify the button which properties RadToolBarSplitButton will use when the RadToolBar is initially displayed.

Example:
C#
The following example demonstrates how to use the <strong>DefaultButtonIndex</strong>
property

<p>
    <p>&lt;telerik:RadToolBar id="RadToolBar1"
    runat="server"&gt;<br />
    &lt;Items&gt;<br />
        &lt;telerik:RadToolBarSplitButton <strong>EnableDefaultButton="true"
           DefaultButtonIndex="1"&gt;</strong>
            &lt;Buttons&gt;<br />
                   &lt;telerik:RadToolBarButton ImageUrl="~/images/red.gif" Text="Red" /&gt;
                   &lt;telerik:RadToolBarButton ImageUrl="~/images/green.gif" Text="Green" /&gt;
                   &lt;telerik:RadToolBarButton ImageUrl="~/images/blue.gif" Text="Blue" /&gt;
            &lt;/Buttons&gt;<br />
           &lt;/telerik:RadToolBarSplitButton&gt;/<br />
    &lt;/Items&gt;<br />
    &lt;/telerik:RadToolBar&gt;</p>
</p>

Gets or sets the height of the dropdown in pixels.

C#
[Bindable(true)]
public Unit DropDownHeight { get; set; }

Implements: IRadToolBarButtonContainer.DropDownHeight

Gets or sets the width of the dropdown in pixels.

C#
[Bindable(true)]
public Unit DropDownWidth { get; set; }

Implements: IRadToolBarButtonContainer.DropDownWidth

Gets or sets a value, indicating if the RadToolBarSplitButton will use the DefaultButton behavior.

C#
[Bindable(true)]
public bool EnableDefaultButton { get; set; }
Property Value:

A value, indicating if the RadToolBarSplitButton wll use the DefaultButton behavior. The default value is true

Use the EnableDefaultButton property to set if RadToolBarSplitButton will use the DefaultButton behavior or not. When the DefaultButton behavior is used, the RadToolBarSplitButton properties are ignored and the properties of the last selected button are used instead. Use the EnableDefaultButton property in conjunction with the DefaultButtonIndex property to specify which of the RadToolBarSplitButton child buttons will be used when the RadToolBar is initially displayed.

Example:
C#
The following example demonstrates how to use the <strong>EnableDefaultButton</strong>
property

<p>
    <p>&lt;telerik:RadToolBar id="RadToolBar1"
    runat="server"&gt;<br />
    &lt;Items&gt;<br />
        &lt;telerik:RadToolBarSplitButton <strong>EnableDefaultButton="true"
           DefaultButtonIndex="1"&gt;</strong>
            &lt;Buttons&gt;<br />
                   &lt;telerik:RadToolBarButton ImageUrl="~/images/red.gif" Text="Red" /&gt;
                   &lt;telerik:RadToolBarButton ImageUrl="~/images/green.gif" Text="Green" /&gt;
                   &lt;telerik:RadToolBarButton ImageUrl="~/images/blue.gif" Text="Blue" /&gt;
            &lt;/Buttons&gt;<br />
           &lt;/telerik:RadToolBarSplitButton&gt;/<br />
    &lt;/Items&gt;<br />
    &lt;/telerik:RadToolBar&gt;</p>
</p>

Gets or sets the expand direction of the drop down.

C#
public ToolBarDropDownExpandDirection ExpandDirection { get; set; }
Property Value:

The expand direction of the drop down. The default value is ToolBarDropDownExpandDirection.Down.

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

Gets or sets the template for displaying the button.

C#
[TemplateContainer(typeof(RadToolBarButton))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public ITemplate ItemTemplate { get; set; }
Property Value:

A ITemplate implemented object that contains the template for displaying the button. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.

Implements: IRadToolBarButton.ItemTemplate

Example:
C#
<p>The following template demonstrates how to add a Calendar control in a certain
ToolBar button.</p>
<p>ASPX:</p>
<p>&lt;telerik:RadToolBar runat="server" ID="RadToolBar1"&gt;</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
    <p>&lt;Items&gt;</p>
    <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
        <p>&lt;telerik:RadToolBarDropDown Text="Date"&gt;</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
            <p>&lt;Items&gt;</p>
            <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
                <p>&lt;ItemTemplate&gt;</p>
                <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
                    <p>&lt;asp:Calendar runat="server" ID="Calendar1"
                       /&gt;</p>
                </blockquote>
                <p>&lt;/ItemTemplate&gt;</p>
            </blockquote>
            <p>&lt;/Items&gt;</p>
        </blockquote>
        <p>&lt;/telerik:RadToolBarDropDown&gt;</p>
    </blockquote>
    <p>&lt;/Items&gt;</p>
</blockquote>
<p>&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the URL to link to when the button is clicked.

C#
[Bindable(true)]
public string NavigateUrl { get; set; }
Property Value:

The URL to link to when the button is clicked. The default value is empty string.

Implements: IRadToolBarButton.NavigateUrl

Use the NavigateUrl property to specify the URL to link to when the button is clicked. Use "~" (tilde) in front of an URL within the same ASP.NET application. When specifying external URL do not forget the protocol (e.g. "http://").

Example:
C#
The following example demonstrates how to use the <strong>NavigateUrl</strong>
property

<p>
    <p>&lt;telerik:RadToolBar id="RadToolBar1"
    runat="server"&gt;<br />
    &lt;Items&gt;<br />
        &lt;telerik:RadToolBarSplitButton Text="News" <strong>NavigateUrl="~/News.aspx"</strong>
        ImageUrl="~/Img/News.gif"&gt;
            &lt;Buttons&gt;<br />
                   &lt;telerik:RadToolBarButton Text="Button1" /&gt;
            &lt;/Buttons&gt;<br />
           &lt;/telerik:RadToolBarSplitButton&gt;/<br />
        &lt;telerik:RadToolBarButton Text="News" <strong>NavigateUrl="~/News.aspx"</strong>
        /&gt;<br />
    &lt;telerik:RadToolBarButton Text="External URL"
    <strong>NavigateUrl="http://www.example.com"</strong> /&gt;<br />
    &lt;/Items&gt;<br />
    &lt;/telerik:RadToolBar&gt;</p>
</p>

Gets or sets a value indicating whether clicking on the button will postback.

C#
public bool PostBack { get; set; }
Property Value:

True if the toolbar split button should postback; otherwise false. By default all the items will postback provided the user has subscribed to the ButtonClick event.

Implements: IRadToolBarButton.PostBack

If you subscribe to the ButtonClick all toolbar buttons will postback. To turn off that behavior you should set the PostBack property to false.

Gets or sets the URL of the page to post to from the current page when the RadToolBarSplitButton is clicked.

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

The URL of the Web page to post to from the current page when the RadToolBarSplitButton is clicked. The default value is an empty string (""), which causes the page to post back to itself.

Implements: IRadToolBarButton.PostBackUrl

Gets or sets the target window or frame to display the Web page content linked to when the toolbar button is clicked.

C#
[TypeConverter(typeof(TargetConverter))]
public string Target { get; set; }
Property Value:

The target window or frame to load the Web page linked to when the button is selected. Values must begin with a letter in the range of a through z (case insensitive), except for the following special values, which begin with an underscore:

The default value is empty string.

Implements: IRadToolBarButton.Target

Use the Target property to specify the frame or window that displays the Web page linked to when the toolbar button is clicked. The Web page is specified by setting the NavigateUrl property.

If this property is not set, the Web page specified by the NavigateUrl property is loaded in the current window.

Example:
C#
<p>The following example demonstrates how to use the <strong>Target</strong>
property</p>
<p>ASPX:</p>
<p>&lt;telerik:RadToolBar runat="server" ID="RadToolBar1"&gt;</p>
<p>&lt;Items&gt;</p>

        <telerik:RadToolBarSplitButton Text="News" NavigateUrl="~/News.aspx"
        <strong>Target="_blank"</strong> ImageUrl="~/Img/News.gif">
            <Buttons><br />
                   <telerik:RadToolBarButton Text="Button1" />
            </Buttons><br />
           </telerik:RadToolBarSplitButton>/<br />
<p>&lt;/Items&gt;</p>
<p>&lt;/telerik:RadToolBar&gt;</p>

Gets or sets the name of the validation group to which the RadToolBarSplitButton belongs.

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

The name of the validation group to which this RadToolBarSplitButton belongs. The default is an empty string (""), which indicates that this property is not set.

Implements: IRadToolBarButton.ValidationGroup

This property works only when CausesValidation is set to true.

Gets or sets the value associated with the toolbar split button.

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

The value associated with the button. The default value is empty string.

Overrides: ControlItem.Value

Implements: IRadToolBarButton.Value

Use the Value property to specify or determine the value associated with the button.

Methods

C#
protected override ControlItemCollection CreateChildItemCollection()
Returns:

ControlItemCollection

Overrides: ControlItem.CreateChildItemCollection()

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

RadToolBarItem.RendererBase

Overrides: RadToolBarItem.CreateRenderer()

C#
protected override string GetCurrentImageUrl()
Returns:

string

Overrides: RadToolBarItem.GetCurrentImageUrl()

C#
protected override void LoadChildViewState(object viewState)
Parameters:viewStateobject

Overrides: ControlItem.LoadChildViewState(object)

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

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

C#
protected override void ReadXml(XmlReader reader)
Parameters:readerXmlReader

Overrides: ControlItem.ReadXml(XmlReader)

C#
protected override object SaveChildViewState()
Returns:

object

Overrides: ControlItem.SaveChildViewState()

C#
protected override void SetChildrenDirty()

Overrides: ControlItem.SetChildrenDirty()

C#
protected override void SetItemContainer(ControlItemContainer itemContainer)
Parameters:itemContainerControlItemContainer

Overrides: ControlItem.SetItemContainer(ControlItemContainer)

C#
protected override void TrackChildViewState()

Overrides: ControlItem.TrackChildViewState()

C#
protected override void WriteXml(XmlWriter writer)
Parameters:writerXmlWriter

Overrides: ControlItem.WriteXml(XmlWriter)