RadToolBarButton
This partial class specifies the rendering of RadToolBarButton.
When the user clicks a toolbar button, the RadToolBar control can either navigate to a linked Web page or simply post back to the server. If the NavigateUrl property of a toolbar button is set, the RadToolBar control navigates to the linked page. By default, a linked page is displayed in the same window or frame as the RadToolBar control. To display the linked content in a different window or frame, use the Target property.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class RadToolBarButton : RadToolBarItem, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IMarkableStateManager, IStateManager, INamingContainer, IXmlSerializable, ICloneable, IRadToolBarButton
Inheritance: objectControlWebControlControlItemRadToolBarItemRadToolBarButton...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadToolBarButton class.
public RadToolBarButton()
Use this constructor to create and initialize a new instance of the RadToolBarButton class using default values.
Initializes a new instance of the RadToolBarButton class with the specified text, checked state and group name data.
public RadToolBarButton(string text, bool isChecked, string group)
The text of the button. The Text property is set to the value of this parameter.
isCheckedboolThe checked state of the button. The Checked property is set to the value of this parameter.
groupstringThe group to which the button belongs. The Group property is set to the value of this parameter.
Use this constructor to create and initialize a new instance of the RadToolBarButton class using the specified text, checked state and group name.
When this constructor used, the CheckOnClick property of the created RadToolBarButton is automatically set to true.
Initializes a new instance of the RadToolBarButton class with the specified text data.
public RadToolBarButton(string text)
The text of the button. The Text property is set to the value of this parameter.
Use this constructor to create and initialize a new instance of the RadToolBarButton class using the specified text.
Properties
Gets or sets a value indicating if a checked button will get unchecked when clicked.
public bool AllowSelfUnCheck { get; set; }
If a checked button will get unchecked when clicked. The default value is false.
Gets or sets a value indicating whether validation is performed when the RadToolBarButton is clicked
public bool CausesValidation { get; set; }
true if validation is performed when the RadToolBarButton is clicked otherwise, false. The default value is true.
Implements:
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 if the button is checked.
public bool Checked { get; set; }
The Checked property of the button depends on the CheckOnClick property. If the CheckOnClick property is set to false, the Checked property will be ignored.
When a button's Checked state is set to true, all the buttons that belong to the same group in the RadToolBar get their Checked state set to false.
Gets or sets the Cascading Style Sheet (CSS) class applied when the toolbar button is checked.
public string CheckedCssClass { get; set; }
The CSS class applied when the toolbar button is checked. The default value is string.Empty.
Gets or sets the path to an image to display for the button when its Checked state is "true".
public string CheckedImageUrl { get; set; }
The path to the image to display when its Checked state is "true". The default value is empty string.
Use the CheckedImageUrl property to specify the image that will be used when the button is checked. If the CheckedImageUrl 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.
Gets or sets whether the button has a check state.
public bool CheckOnClick { get; set; }
Gets or sets an optional parameter passed to the Command event of the RadToolBar instance along with the associated CommandName
public string CommandArgument { get; set; }
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:
Gets or sets the command name associated with the toolbar button that is passed to the ItemCommand event of the RadToolBar instance.
public string CommandName { get; set; }
The command name of the toolbar button. The default value is an empty string.
Implements:
Gets the data item that is bound to the button
[Browsable(false)]
public override object DataItem { get; set; }
An Object that represents the data item that is bound to the button. The default value is null (Nothing in Visual Basic), which indicates that the button is not bound to any data item. The return value will always be null unless accessed within a ButtonDataBound event handler.
Overrides:
This property is applicable only during data binding. Use it along with the ButtonDataBound event to perform additional mapping of fields from the data item to RadToolBarButton properties.
Gets or sets the group to which the button belongs.
public string Group { get; set; }
The Group property of the button depends on the CheckOnClick property. When several buttons in the RadToolBar are assigned to the same group, checking one of them will uncheck the one that is currently checked. If the CheckOnClick property is set to false, the Group property will be ignored.
Gets or sets whether the button is separator.
public bool IsSeparator { get; set; }
Gets or sets the template for displaying the button.
[TemplateContainer(typeof(RadToolBarButton))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public ITemplate ItemTemplate { get; set; }
A ITemplate implemented object that contains the template for displaying the item. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.
Implements:
Gets or sets the URL to link to when the button is clicked.
[Bindable(true)]
public string NavigateUrl { get; set; }
The URL to link to when the button is clicked. The default value is empty string.
Implements:
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://").
Gets a reference to the owner of the RadToolBarButton.
[Browsable(false)]
[Bindable(false)]
public IRadToolBarItemContainer Owner { get; }
The IToolBarItemContainer control (RadToolBar, RadToolBarDropDown, RadToolBarSplitButton) which holds the RadToolBarButton.
Gets or sets a value indicating whether clicking on the button will postback.
public bool PostBack { get; set; }
True if the toolbar button should postback; otherwise false. By default all the items will postback provided the user has subscribed to the ButtonClick event.
Implements:
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 RadToolBarButton is clicked.
public string PostBackUrl { get; set; }
The URL of the Web page to post to from the current page when the RadToolBarButton is clicked. The default value is an empty string (""), which causes the page to post back to itself.
Implements:
Gets or sets the target window or frame to display the Web page content linked to when the toolbar button is clicked.
[TypeConverter(typeof(TargetConverter))]
public string Target { get; set; }
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:
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.
Gets or sets the name of the validation group to which the RadToolBarButton belongs.
public string ValidationGroup { get; set; }
The name of the validation group to which this RadToolBarButton belongs. The default is an empty string (""), which indicates that this property is not set.
Implements:
This property works only when CausesValidation is set to true.
Gets or sets the value associated with the toolbar button.
public override string Value { get; set; }
The value associated with the button. The default value is empty string.
Overrides:
Implements:
Use the Value property to specify or determine the value associated with the button.
Methods
Creates a copy of the current RadToolBarButton object.
public RadToolBarButton Clone()
A RadToolBarButton which is a copy of the current one.
Use the Clone method to create a copy of the current button. All properties of the clone are set to the same values as the current ones.
protected override ControlItemCollection CreateChildItemCollection()
Overrides:
protected override RadToolBarItem.RendererBase CreateRenderer()
Overrides:
protected override void LoadFromDictionary(IDictionary<string, object> dictionary)
Overrides:
protected override void SetItemContainer(ControlItemContainer itemContainer)
Overrides: